tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GeolocationUIUtilsWin.sys.mjs (900B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 /**
      6 * Implements nsIGeolocationUIUtilsWin
      7 *
      8 * @class GeolocationUIUtilsWin
      9 */
     10 export class GeolocationUIUtilsWin {
     11  dismissPrompts(aBrowsingContext) {
     12    // browser will be null if the tab was closed
     13    let embedder = aBrowsingContext?.top.embedderElement;
     14    let owner = embedder?.ownerGlobal;
     15    if (owner) {
     16      let dialogBox = owner.gBrowser.getTabDialogBox(embedder);
     17      // Don't close any content-modal dialogs, because we could be doing
     18      // content analysis on something like a prompt() call.
     19      dialogBox.getTabDialogManager().abortDialogs();
     20    }
     21  }
     22 }
     23 
     24 GeolocationUIUtilsWin.prototype.QueryInterface = ChromeUtils.generateQI([
     25  "nsIGeolocationUIUtilsWin",
     26 ]);