I'm new to WebExtensions and trying to port a minimal example called borderify from v2 to v3.
I tried the minimal step of setting manifest.json
's manifest_version: 3
, but I quickly learned this breaks the content script running automatically.
{
"manifest_version": 3,
"name": "Borderify",
"content_scripts": [
{
"matches": ["*://*.mozilla.org/*"],
"js": ["borderify.js"]
}
],
...
}
borderify.js aka the content script
document.body.style.border = "5px solid red";
On v3, it appears necessary to manually click the extension icon in the browser UI to actually run the content_scripts. This seems like a regression -- what am I missing?
How canĀ I get the content script to automatically load the old v2 way? It'd be ideal to avoid needing permissions, if possible. Is this behavior possible in v3?
Firefox 119.0, macOS 13.6
TIL there appears to be a new (mandatory?) permissions granting flow with v3 extensions.
After installing a v3 extension, when browsing to a domain that matches it's content_script's
matches
, the extension icon will get a dot:and the user has to manually activate the extension in a separate click:
I can understand the argument for it but it's still adding annoying friction for non-technical users.
I hope to find if there's a way to avoid this extra manual step e.g. with
host_permissions
or some other trick.