, Firefox - . , window, , , . , JavaScript HTML-. , . , window. HTML- .
nsIWindowMediator. MDN , :
Components.utils.import("resource://gre/modules/Services.jsm");
function forEachOpenWindow(todo)
{
var windows = Services.wm.getEnumerator("navigator:browser");
while (windows.hasMoreElements())
todo(windows.getNext().QueryInterface(Components.interfaces.nsIDOMWindow));
}
window /, . window /. SDK Add-on, overlay/bootstrap, , .
Firefox -.
if (window === null || typeof window !== "object") {
}
Alternatively using Services.jsm to access nsIWindowMediator :
if (window === null || typeof window !== "object") {
}
source
share