Commit d0b3fa67 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

BB 43664: Automatically check the PBM checkbox when in always-on PBM.

parent 181f221a
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
  ExtensionPermissions: "resource://gre/modules/ExtensionPermissions.sys.mjs",
  OriginControls: "resource://gre/modules/ExtensionPermissions.sys.mjs",
  PERMISSION_L10N: "resource://gre/modules/ExtensionPermissionMessages.sys.mjs",
  PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
  SITEPERMS_ADDON_TYPE:
    "resource://gre/modules/addons/siteperms-addon-utils.sys.mjs",
});
@@ -466,7 +467,9 @@ customElements.define(
        this.notification.options.customElementOptions;

      let checkboxEl = this.ownerDocument.createElement("moz-checkbox");
      checkboxEl.checked = grantPrivateBrowsingAllowed;
      checkboxEl.checked =
        grantPrivateBrowsingAllowed ||
        lazy.PrivateBrowsingUtils.permanentPrivateBrowsing;
      checkboxEl.addEventListener("change", () => {
        // NOTE: the popupnotification instances will be reused
        // and so the callback function is destructured here to