WebExtension module: Track
activeTab
permission; automatically inject content scripts
The main use case is to ship your extension without host_permissions
and have the user invoke the extension on click on any website.
Alternatively, consider using webext-permission-toggle and webext-dynamic-content-scripts to permanently receive access to certain hosts and automatically register content scripts on it.
npm install webext-active-tab
This package exports various utilities, just import what you need.
- on-active-tab - Watch when tabs receive
activeTab
- register-active-tab-scripts - Automatically inject scripts into tabs with
activeTab
Note
Firefox has some limitations:
activeTab
seems to be lost after a reload- further
contextMenu
clicks receive a moz-extension URL rather than the current page’s URL
- webext-dynamic-content-scripts - Automatically registers your
content_scripts
on domains added viapermission.request
. - webext-events - High-level events and utilities for events in Web Extensions
- Awesome-WebExtensions - A curated list of awesome resources for WebExtensions development.
- More…
MIT © Federico Brigante