-
-
Notifications
You must be signed in to change notification settings - Fork 13
Drop support for MV2 Chrome #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- run: xvfb-run --auto-servernum npm run jest:core | ||
env: | ||
TARGET: ${{ matrix.version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"these-are-just-mocks-for-parcel-tests": "yolo", | ||
"webext-permissions": "./test/demo-extension/webext-permissions.js", | ||
"webext-dynamic-content-scripts": "./source/" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related:
In this case I was able to move these to sub-folders so they don't get published.
"allFrames": undefined, | ||
"css": undefined, | ||
"excludeMatches": [ | ||
"https://content-script.example.com/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade. However not really useful because Chrome natively deduplicates scripts now.
source/deduplicator.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files can be registered multiple times; Chrome only injects them once (just like native content scripts)
if (origins.includes(origin)) { | ||
// eslint-disable-next-line no-await-in-loop | ||
const script = await scriptPromise; | ||
void script.unregister(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this did not work in event pages and service workers. Nothing happened then, they'd just be left behind but never injected.
} | ||
|
||
// Registration successful, now inject into existing tabs | ||
await injectToExistingTabs([origin], [config]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the browser still remembers scripts registered in past sessions, so this this now only runs when the scripts were not previously registered.
@@ -1,38 +0,0 @@ | |||
import registerContentScriptPonyfill from 'content-scripts-register-polyfill/ponyfill.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bye ponyfill 🙏
test/demo-extension/manifest.json
Outdated
"version": "0.0.0", | ||
"manifest_version": 3, | ||
"permissions": ["webNavigation", "scripting", "contextMenus", "activeTab", "storage"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mistake. webNavigation
is still needed for including-active-tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to dedicated module:
MV2 Firefox presumably still works, but no more official support in v11+
Need MV2? Use v10