When it’s loaded as a temporary add-on, FF displays a warning/error.
Warning details
Reading manifest: Warning processing host_permissions: Error processing host_permissions.0: Value “xyz” must either: be one of [“<all_urls>”], must either [match the pattern /^(https?|wss?|file|ftp|*)://(*|*.[^/]+|[^/]+)/.$/, or match the pattern /^file:///.$/], or match the pattern /^resource://(*|*.[^/]+|[^/]+)/.*$|^about:/
FF MV3 lets the user toggle an extension’s optional permissions in about:addons
I want to warn the user if they
disable a permission the extension currently needs
enable a permission the extension currently doesn’t need
browser.permissions.onAdded.addListener(async permissions => {
let [ active_tab ] = await browser.tabs.query({ lastFocusedWindow: true, active: true });
if (active_tab.url === "about:addons") {
// If the extension doesn't need the permission, warn the user
console.log("permissions.onAdded - check if we need to warn the user");
}
else {
console.log("permissions.onAdded - don't warn the user");
}
})
To access Tab.url, Tab.title, and Tab.favIconUrl (or to filter by these properties via tabs.query()), you need to have the “tabs” permission, or have host permissions that match Tab.url.
With an “about:addons” host permission, I wouldn’t need the “tabs” permission.
But I can live with requiring the “tabs” permission in this case.