webext-events
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

webext-events

High-level events and utilities for events in Web Extensions

Install

npm install webext-events

Or download the standalone bundle to include in your manifest.json.

Usage

This package exports various utilities, just import what you need.

  • onContextInvalidated - Fires in content scripts when the extension is disabled, updated or reloaded.
  • onExtensionStart - Fires when the extension starts or is enabled. This is what yuou thought chrome.runtime.onStartup was for.
  • oneEvent - Creates a promise that resolves when an event is received.
  • addListener - Like .addEventListener but with a signal to remove the listener.

Related

License

MIT © Federico Brigante

Package Sidebar

Install

npm i webext-events

Weekly Downloads

10,865

Version

3.1.1

License

MIT

Unpacked Size

20.9 kB

Total Files

27

Last publish

Collaborators

  • fregante