I built a singlepage website using a larger javascript framework, which is loaded during startup of the page.
Now I try to span the page content over multiple tabs. For doing this, I open new tabs using subtab = window.open("","_blank")
and fill the new windows dynamically with javascript subtab.document.body = ...
.
Unfortunately I am not able to use the framework of the parent page. JQuery and the used KendoUI and Leaflet framework are not available within this childrens' contexts.
I know there are multiple possibilities to communicate between tabs:
- Using the window.opener link to the parent page
- Using cookies
- Using localStorage
While the last two approaches are only interesting for sharing plain data, I played around with the first option. I tried to map interesting namespaces from the parent page to the subwindows global namespace XY = opener.XY. But it seems like it is not possible to solve the problem like this. (self = self.opener
does not work either.) It's the same thing for css files.
So my question: Is there a possibility to reuse the whole window context of the opener within its child windows? Or does the cache work across multiple tabs and I can just include the whole framework again and again without causing a real reload?