Can I get some clarity here: I have a web game hosted at https://codedread.itch.io - I understand that underneath it's an iframe (https://html-classic.itch.zone/html/(some number)/ as I update my web game, am I likely to lose that underlying origin such that anything stored in IndexedDB is lost?
Viewing post in How to save data?
I don't know if the iframe URL is likely to change, but one thing you can do is redirect the user to a domain you control. You upload a single HTML file to Itch, which contains some Javascript that redirects to the URL where your game is actually hosted. You can choose to change only the iframe URL, in which case the game will still be embedded in your Itch page, or you can redirect the whole page when the user clicks the Play button.
One recent nuisance is that Safari has started deleting sites' saved data if they're not used for a week (for "privacy"). There may be additional restrictions on iframes in Safari and other browsers—I vaguely remember something about that, because of them being used for cross-site tracking. To avoid all this, I'm moving saved games to the server, and I'm working on a system which will provide one-click sign-up with no personal data collection. There's no reason why I shouldn't make it available to other people too, once it's done, so if you'd be interested in this route let me know and I'll keep you updated.
I like your idea, but upon testing it, unless I redirect the entire page to my host, the IndexedDB instance is not shared, despite the iframe hosted at itch.io pointing to the same site. This was surprising to me.
I'd rather keep the itch.io link stable. I think I'll cross my fingers that itch.io doesn't change the underlying iframe host they control. I use the Google Drive API to host saved games so that's also an option for players.