chat/modules/hiddenWindow.jsm
author Ben Bucksch <ben.bucksch@beonex.com>
Sat, 15 Feb 2020 12:54:00 +0200
changeset 37355 f66ebccec17986b2a453c42a40e1c53f0042518d
parent 35696 e5737872508567abf8b0444f43eb4ee4ce211c75
child 38076 7853102282e6bc50b8a2317e86b5185b0c5c250d
permissions -rw-r--r--
Bug 1615137 - Remove duplicate include of lightning-toolbar.dtd file. r=pmorris DONTBUILD

/* 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/. */

this.EXPORTED_SYMBOLS = ["getHiddenHTMLWindow"];

const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { XPCOMUtils } = ChromeUtils.import(
  "resource://gre/modules/XPCOMUtils.jsm"
);

XPCOMUtils.defineLazyGetter(
  this,
  "hiddenWindow",
  () => Services.appShell.hiddenDOMWindow
);

function getHiddenHTMLWindow() {
  if (Services.appinfo.OS == "Darwin") {
    let browser = hiddenWindow.document.getElementById("hiddenBrowser");
    return browser.docShell ? browser.contentWindow : hiddenWindow;
  }
  return hiddenWindow;
}