Note that there are some explanatory texts on larger screens.

plurals
  1. POShare local non-serializable data across pages in JavaScript
    text
    copied!<p>I have reasonable experience with web development and I'm fairly certain this is not possible, but i'd like to open this question up to the community just in case someone can think of something niche/genius enough that it might work.</p> <p>To preface this, i'm happy for this to be as 'outside of the box' as anyone can think of, as it's already - i think - a foregone conclusion that there will be no run-of-the-mill one-size-fits-all solutions for this.</p> <p>I'd like to share data (specifically, non-serializable data, like a <code>websocket</code>) across two different pages on the same domain. I'm happy to use <code>HTML 5</code> features like local storage and webworkers, but the requirement is that there is no <strong>visible</strong> anchoring mechanism (like a popup window that bridges the two pages), and that <strong>only one page from the domain be visibly open at a time</strong>. I.e. you're on a page, you click a link, leave that page, and move onto the next - but the data persists. </p> <p>The trick here is the one-page-at-a-time bit. If we could have two pages open concurrently, then we could potentially anchor the data in a <code>shared web worker</code>. However, on a single page, the web worker dies in the moment you click a link and move off the current page and onto the next, even for same domain navigation, as you might expect. </p> <p>In Chrome you could use a <code>background page</code> from a webapp - but ideally, i'd like something that didn't require installing 'extras' like webapps, or would at least have a shot at one day being cross browser when compliance catches up. </p> <p>Again, i don't really think this is doable, but thought i'd ask in case someone more knowledgeable of frontend dev has any ideas. I realise in an often stateless world this is asking quite a lot.</p> <p>Thanks!</p> <p>EDIT: A further requirement is that ajax reloading of the content such that the top-level page is never actually terminated/reloaded is not an option in this case.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload