summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/content
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/extensions/content')
-rw-r--r--toolkit/mozapps/extensions/content/aboutaddons.html3
-rw-r--r--toolkit/mozapps/extensions/content/aboutaddons.js62
-rw-r--r--toolkit/mozapps/extensions/content/aboutaddonsCommon.js17
-rw-r--r--toolkit/mozapps/extensions/content/abuse-reports.js2
-rw-r--r--toolkit/mozapps/extensions/content/shortcuts.js2
-rw-r--r--toolkit/mozapps/extensions/content/view-controller.js2
6 files changed, 26 insertions, 62 deletions
diff --git a/toolkit/mozapps/extensions/content/aboutaddons.html b/toolkit/mozapps/extensions/content/aboutaddons.html
index 55d6625c08..d0930ef42d 100644
--- a/toolkit/mozapps/extensions/content/aboutaddons.html
+++ b/toolkit/mozapps/extensions/content/aboutaddons.html
@@ -13,9 +13,6 @@
content="default-src chrome:; style-src chrome: 'unsafe-inline'; img-src chrome: file: jar: https: http:; connect-src chrome: data: https: http:; object-src 'none'"
/>
<meta name="color-scheme" content="light dark" />
- <link rel="stylesheet" href="chrome://global/content/tabprompts.css" />
- <link rel="stylesheet" href="chrome://global/skin/tabprompts.css" />
-
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
<link
rel="stylesheet"
diff --git a/toolkit/mozapps/extensions/content/aboutaddons.js b/toolkit/mozapps/extensions/content/aboutaddons.js
index 39c4656210..d7d9c28ae6 100644
--- a/toolkit/mozapps/extensions/content/aboutaddons.js
+++ b/toolkit/mozapps/extensions/content/aboutaddons.js
@@ -322,12 +322,12 @@ function checkForUpdate(addon) {
onDownloadFailed: failed,
onInstallCancelled: failed,
onInstallFailed: failed,
- onInstallEnded: (...args) => {
+ onInstallEnded: () => {
detachUpdateHandler(install);
install.removeListener(updateListener);
resolve({ installed: true, pending: false, found: true });
},
- onInstallPostponed: (...args) => {
+ onInstallPostponed: () => {
detachUpdateHandler(install);
install.removeListener(updateListener);
resolve({ installed: false, pending: true, found: true });
@@ -375,7 +375,7 @@ const OPTIONS_TYPE_MAP = {
// Check if an add-on has the provided options type, accounting for the pref
// to disable inline options.
-function getOptionsType(addon, type) {
+function getOptionsType(addon) {
return OPTIONS_TYPE_MAP[addon.optionsType];
}
@@ -1064,7 +1064,7 @@ class AddonPageOptions extends HTMLElement {
}
}
- async checkForUpdates(e) {
+ async checkForUpdates() {
let message = document.getElementById("updates-message");
message.state = "updating";
message.hidden = false;
@@ -2096,11 +2096,11 @@ class AddonDetails extends HTMLElement {
}
}
- onDisabled(addon) {
+ onDisabled() {
this.extensionShutdown();
}
- onEnabled(addon) {
+ onEnabled() {
this.extensionStartup();
}
@@ -2451,45 +2451,27 @@ class AddonCard extends HTMLElement {
async setAddonPermission(permission, type, action) {
let { addon } = this;
- let origins = [],
- permissions = [];
+ let perms = { origins: [], permissions: [] };
+
if (!["add", "remove"].includes(action)) {
throw new Error("invalid action for permission change");
}
- if (type == "permission") {
- if (
- action == "add" &&
- !addon.optionalPermissions.permissions.includes(permission)
- ) {
- throw new Error("permission missing from manifest");
- }
- permissions = [permission];
- } else if (type == "origin") {
- if (action === "add") {
- let { origins } = addon.optionalPermissions;
- let patternSet = new MatchPatternSet(origins, { ignorePath: true });
- if (!patternSet.subsumes(new MatchPattern(permission))) {
- throw new Error("origin missing from manifest");
- }
- }
- origins = [permission];
- // If this is one of the "all sites" permissions
- if (Extension.isAllSitesPermission(permission)) {
- // Grant/revoke ALL "all sites" optional permissions from the manifest.
- origins = addon.optionalPermissions.origins.filter(perm =>
- Extension.isAllSitesPermission(perm)
- );
- }
+ if (type === "permission") {
+ perms.permissions = [permission];
+ } else if (type === "origin") {
+ perms.origins = [permission];
} else {
throw new Error("unknown permission type changed");
}
- let policy = WebExtensionPolicy.getByID(addon.id);
- ExtensionPermissions[action](
- addon.id,
- { origins, permissions },
- policy?.extension
+
+ let normalized = ExtensionPermissions.normalizeOptional(
+ perms,
+ addon.optionalPermissions
);
+
+ let policy = WebExtensionPolicy.getByID(addon.id);
+ ExtensionPermissions[action](addon.id, normalized, policy?.extension);
}
async handleEvent(e) {
@@ -2968,18 +2950,18 @@ class AddonCard extends HTMLElement {
this.sendEvent("update-postponed");
}
- onDisabled(addon) {
+ onDisabled() {
if (!this.reloading) {
this.update();
}
}
- onEnabled(addon) {
+ onEnabled() {
this.reloading = false;
this.update();
}
- onInstalled(addon) {
+ onInstalled() {
// When a temporary addon is reloaded, onInstalled is triggered instead of
// onEnabled.
this.reloading = false;
diff --git a/toolkit/mozapps/extensions/content/aboutaddonsCommon.js b/toolkit/mozapps/extensions/content/aboutaddonsCommon.js
index 9315e35861..fd91ba58be 100644
--- a/toolkit/mozapps/extensions/content/aboutaddonsCommon.js
+++ b/toolkit/mozapps/extensions/content/aboutaddonsCommon.js
@@ -5,7 +5,7 @@
"use strict";
-/* exported attachUpdateHandler, detachUpdateHandler, gBrowser,
+/* exported attachUpdateHandler, detachUpdateHandler,
* getBrowserElement, installAddonsFromFilePicker,
* isCorrectlySigned, isDisabledUnsigned, isDiscoverEnabled,
* isPending, loadReleaseNotes, openOptionsInTab, promiseEvent,
@@ -196,21 +196,6 @@ function showPermissionsPrompt(addon) {
});
}
-// Stub tabbrowser implementation for use by the tab-modal alert code
-// when an alert/prompt/confirm method is called in a WebExtensions options_ui
-// page (See Bug 1385548 for rationale).
-var gBrowser = {
- getTabModalPromptBox(browser) {
- const parentWindow = window.docShell.chromeEventHandler.ownerGlobal;
-
- if (parentWindow.gBrowser) {
- return parentWindow.gBrowser.getTabModalPromptBox(browser);
- }
-
- return null;
- },
-};
-
function isCorrectlySigned(addon) {
// Add-ons without an "isCorrectlySigned" property are correctly signed as
// they aren't the correct type for signing.
diff --git a/toolkit/mozapps/extensions/content/abuse-reports.js b/toolkit/mozapps/extensions/content/abuse-reports.js
index c6461a071b..38fa0f9f46 100644
--- a/toolkit/mozapps/extensions/content/abuse-reports.js
+++ b/toolkit/mozapps/extensions/content/abuse-reports.js
@@ -185,7 +185,7 @@ async function openAbuseReport({ addonId, reportEntryPoint }) {
// to be async, but it is so that both the implementations will be providing
// the same type signatures (returning a promise) to the callers, independently
// from which abuse reporting feature is enabled.
-async function openAbuseReportAMOForm({ addonId, reportEntryPoint }) {
+async function openAbuseReportAMOForm({ addonId }) {
const amoUrl = AbuseReporter.getAMOFormURL({ addonId });
windowRoot.ownerGlobal.openTrustedLinkIn(amoUrl, "tab", {
// Make sure the newly open tab is going to be focused, independently
diff --git a/toolkit/mozapps/extensions/content/shortcuts.js b/toolkit/mozapps/extensions/content/shortcuts.js
index 59420226df..99ab1c5161 100644
--- a/toolkit/mozapps/extensions/content/shortcuts.js
+++ b/toolkit/mozapps/extensions/content/shortcuts.js
@@ -283,7 +283,7 @@ ChromeUtils.defineESModuleGetters(this, {
}
return Object.entries(modifierMap)
- .filter(([key, isDown]) => isDown)
+ .filter(([, isDown]) => isDown)
.map(([key]) => key)
.concat(getStringForEvent(e))
.join("+");
diff --git a/toolkit/mozapps/extensions/content/view-controller.js b/toolkit/mozapps/extensions/content/view-controller.js
index 978a44d176..b82c1d6e6d 100644
--- a/toolkit/mozapps/extensions/content/view-controller.js
+++ b/toolkit/mozapps/extensions/content/view-controller.js
@@ -89,7 +89,7 @@ var gViewController = {
}
},
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic == "EM-ping") {
this.readyForLoadView = true;
Services.obs.notifyObservers(window, "EM-pong");