2012-05-30 20:48:24 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2012-03-13 05:14:45 +04:00
|
|
|
|
2015-10-08 16:54:02 +03:00
|
|
|
this.EXPORTED_SYMBOLS = ["getHiddenHTMLWindow"];
|
2012-03-13 05:14:45 +04:00
|
|
|
|
2019-08-30 20:43:03 +03:00
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|
|
|
const { XPCOMUtils } = ChromeUtils.import(
|
|
|
|
"resource://gre/modules/XPCOMUtils.jsm"
|
|
|
|
);
|
2012-03-13 05:14:45 +04:00
|
|
|
|
2019-08-30 20:43:03 +03:00
|
|
|
XPCOMUtils.defineLazyGetter(
|
|
|
|
this,
|
|
|
|
"hiddenWindow",
|
|
|
|
() => Services.appShell.hiddenDOMWindow
|
2012-03-13 05:14:45 +04:00
|
|
|
);
|
2019-03-01 23:24:17 +03:00
|
|
|
|
2012-03-13 05:14:45 +04:00
|
|
|
function getHiddenHTMLWindow() {
|
2019-03-01 23:24:17 +03:00
|
|
|
if (Services.appinfo.OS == "Darwin") {
|
|
|
|
let browser = hiddenWindow.document.getElementById("hiddenBrowser");
|
|
|
|
return browser.docShell ? browser.contentWindow : hiddenWindow;
|
|
|
|
}
|
|
|
|
return hiddenWindow;
|
2012-03-13 05:14:45 +04:00
|
|
|
}
|