Skip to content
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

Automatically listen to activetab (optionally?) #41

Closed
fregante opened this issue Aug 8, 2022 · 0 comments · Fixed by #44
Closed

Automatically listen to activetab (optionally?) #41

fregante opened this issue Aug 8, 2022 · 0 comments · Fixed by #44

Comments

@fregante
Copy link
Owner

fregante commented Aug 8, 2022

In some cases (most?) you'd also want the content script to be automatically available on the activeTab as well. This would avoid conflicting scripts trying to inject the script via different code paths:

ActiveTab-tracking code can be found here and will likely be extracted, maybe into webext-tools:

On top of that, I think it also needs to listen to tabs and manually inject the scripts instead of relying on registerContentScripts. However it seems that the API supports activeTab in MV3: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/scripting/registerContentScripts


To preserve the side-effects-only nature of the module, I think it can export an additional entry point:

import 'webext-dynamic-content-scripts/including-activetab';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant