I am working on Firefox extension that overwrite new tab page and I need to hide my page URL from address bar. I use this code:
if (gInitialPages.indexOf(NEW_TAB_URL)===-1) gInitialPages.push(NEW_TAB_URL);
It works correctly in XUL Overlay code, but I'm getting an error when I try to make my application restartless and move this code to bootstrap.js:
gInitialPages is not defined
So, how can I use gInitialPages
(or anything similar) in bootstrapped extensions?
Bootstrapped/restartless extensions do NOT automagically run in the context of (a) window(s).
bootstrap.js
runs in an own context, only once per application instance, not in the browser window.
You'll need to:
And then manipulate the variable in those windows.
See Mardak's example on how you could do that, in particular watchWindows
and unload
.