04-23-2025, 05:20 PM
(04-23-2025, 05:31 AM)SMcNeill Wrote: ...
Quote:After some research, I suspect that the issue arises due to the sketch being contained in an <iframe> Tag (preview.p5js.org) and the local storage object being stored in the browser under that subdomain. The local storage being cleared after a browser reset is likely a WebKit security measure to prevent third party tracking ("Intelligent Tracking Prevention" https://webkit.org/blog/7675/intelligent...revention/). One solution could be to store and access the local storage object under the domain editor.p5js.org. But this exceeds the scope of my understanding.
Note 2: Safari and iPad erases *all* browser storage after seven days of it being unvisited. That's another of their security features they pushed on the public a while back to protect us all from ourselves. /sigh. Makes a real PITA with some of the html5 browser games. Take a break, start over...
This is why we can't have nice things!
I typically don't use local storage for anything too important, user preferences, things like that. In the example above it was just being used as a simple mechanism for communication between different QBJS apps that have been included into a parent page via iframes. You can actually see that the storage value is cleared each time the page is loaded.


