Context: I’m my bubble app i am writing values to the users browser local storage. I then need to read the stored values when the user goes to a totally separate domain from bubble app’s domain where they are written.
So in my bubble app, i think i need something along the lines of
// Parent window
const iframe = document.getElementById(‘yourIframe’); // Replace with the actual ID of your iframe
// Send a message to the iframe
iframe.contentWindow.postMessage(‘RequestLocalStorageValue’, ‘https://your-iframe-domain.com’);
// Optionally, receive the response from the parent
window.addEventListener(‘message’, (event) => {
if (event.origin === ‘https://your-parent-domain.com’) {
const localStorageValue = event.data;
console.log(‘Received localStorage value from parent:’, localStorageValue);
}
});
This is a paid engagement for anyone who is happy to share their time.