webext-active-tab
v0.10.0
Published
WebExtension module: Track `activeTab` permission; automatically inject content scripts
Maintainers
Readme
webext-active-tab 
WebExtension module: Track
activeTabpermission; 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.
Install
npm install webext-active-tabUsage
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:
activeTabseems to be lost after a reload- further
contextMenuclicks receive a moz-extension URL rather than the current page’s URL
Related
- webext-dynamic-content-scripts - Automatically registers your
content_scriptson 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…
License
MIT © Federico Brigante
