Local things? (for instant data between tabs or parent-iframe)

Hi there!

My app’s structure needs a setup, where pages get loaded in an iframe (all within the same domain).
I need to figure out a way to pass data from parent window to the page loaded in that iframe.

I tried passing GET parameters, but it reloads the page in the iframe. I tried doing it with iframe.contentWindow.history.replaceState without success (nothing happens).

I also tried working with local storage, but I can’t find a way to get data updated (on the page in the iframe) automatically upon its change in local storage.

The last thing I tried was to set up a “helper” data type in the database, so that I can pass data to an iframe with all the data reactivity benefits, but it is not instant, as goes through bubble servers.

Any idea of how to achieve this kind of data exchange between tabs/parent-iframe widnows without reload?

Thanks in advance!

1 Like

I’ve been looking into this myself. From what I can tell it can be done, but requires Javascript to do so, so you’ll need a plugin in Bubble to help.

Have a read of this and let me know if it helps https://stackoverflow.com/questions/10435512/capture-incoming-url-parameters-then-pass-to-iframe-src-with-javascript

Thanks for the input. Unfortunately, any iframe.src changes translates into reload of the iframe.

In my case, I can’t allow iframe to reload. iframe.contentWindow.history.replaceState, in theory, must have worked, but it doesn’t. It does not change the url (hence parameters) of an iframe.

Ah I see! Hmm, tricky then as most I’ve come across would indeed require a page refresh. Not sure, maybe @NigelG has some knowledge here