tor-browser

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

GeckoViewSettingsChild.sys.mjs (883B)


      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 import { GeckoViewActorChild } from "resource://gre/modules/GeckoViewActorChild.sys.mjs";
      6 
      7 // Handles GeckoView content settings
      8 export class GeckoViewSettingsChild extends GeckoViewActorChild {
      9  receiveMessage(message) {
     10    const { name } = message;
     11    debug`receiveMessage: ${name}`;
     12 
     13    switch (name) {
     14      case "SettingsUpdate": {
     15        const settings = message.data;
     16 
     17        if (settings.isExtensionPopup) {
     18          // Allow web extensions to close their own action popups (bz1612363)
     19          this.contentWindow.windowUtils.allowScriptsToClose();
     20        }
     21      }
     22    }
     23  }
     24 }
     25 
     26 const { debug, warn } = GeckoViewSettingsChild.initLogging("GeckoViewSettings");