Generate Manifest v3 extension builds
Background / User story
In #972 (closed) we replaced adblockpluscore with EWE, so that we can more easily support both Manifest v2 and Manifest v3 with the same codebase. While adding Manifest v3 support to EWE is a work in progress (see milestone), we can already start generating Manifest v3 extension builds based on it.
See also Manifest v3 migration guide.
What to change
- Design: N/A
- Research: N/A
- Spec: N/A
- Legal: N/A
-
Development:
- Introduce CLI parameter for specifying whether to generate a Manifest v2 or v3 extension build.
- Add support for generating Manifest v3 extension build.
- Use adjusted manifest.json file.
- Set
manifest_version
to3
. - Use
background.service_worker
. - Rename
browser_action
toaction
. - Replace "webRequestBlocking" permission with "declarativeNetRequest".
- Move "<all_urls>" permission to
host_permissions
. - Add "scripting" permission.
- Set
- Generate background.js bundle.
- Use Manifest v3 APIs:
- Replace
browser.browserAction.*
withbrowser.action.*
. - Replace
browser.tabs.executeScript()
withbrowser.scripting.executeScript()
.
- Replace
- Use adjusted manifest.json file.
- Generate Manifest v3 extension builds in GitLab CI.
Hints for testers
- Manifest v2 builds can be installed on all currently supported browsers.
- Manifest v3 builds can be installed on all Chromium-based browsers, but only those based on Chromium 100+ are expected to work at this point (see related issues below).
- Manifest v3 Chrome and Firefox builds should be generated in the CI alongside Manifest v3 builds.
- The SDK is not compatible with Manifest v3 yet. Therefore no functionality provided via the SDK (incl. ad blocking) is currently expected to work.
- The addition of the "scripting" permission shouldn't cause any problems (e.g. user being asked about accepting new permissions, causing extension to be disabled) when updating to the new extension version.
- The toolbar icon should behave as usual (e.g. animating the icon, updating the icon image and text, clicking on the icon).
- Window information (i.e. opener and referrer URL) should be included in issue report data.
- Extracting the language information from a web page for the language filter lst recommendation should continue to work as before.
Hints for translators
N/A
Edited by Thomas Greiner