Skip to content
Snippets Groups Projects
Verified Commit 48351652 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

MB 20: Allow packaged-addons in PBM.

We install a few addons from the distribution directory, but they are
not automatically enabled for PBM mode.
This commit modifies the code that installs them to also add the PBM
permission to the known ones.
parent 6323523b
No related branches found
No related tags found
1 merge request!101MB 261: Rebased MB alpha onto 115.7.0
......@@ -45,6 +45,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
ExtensionPermissions: "resource://gre/modules/ExtensionPermissions.jsm",
XPIDatabase: "resource://gre/modules/addons/XPIDatabase.jsm",
XPIDatabaseReconcile: "resource://gre/modules/addons/XPIDatabase.jsm",
XPIInstall: "resource://gre/modules/addons/XPIInstall.jsm",
......@@ -2990,6 +2991,19 @@ var XPIProvider = {
}
aManifests[loc.name][id] = addon;
changed = true;
// mullvad-browser#20: Allow pre-installed extensions in PBM
const PRIVATE_ALLOWED_PERMISSION =
"internal:privateBrowsingAllowed";
if (
addon.id === "uBlock0@raymondhill.net" ||
addon.id == "{d19a89b9-76c1-4a61-bcd4-49e8de916403}"
) {
lazy.ExtensionPermissions.add(addon.id, {
permissions: [PRIVATE_ALLOWED_PERMISSION],
origins: [],
});
}
}
} catch (e) {
logger.error(`Failed to install distribution add-on ${file.path}`, e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment