A set of core libraries and tools for building web extensions. These libraries are built on top of webextension-polyfill
and support all major browsers.
A lightweight, type-safe wrapper around the messaging API
Local storage based, type-safe wrappers around the storage API
An in-memory implementation of the
Browser
APIs for testingWrite services that can be called from any JS context, but run in the background service worker
Isolate content script UIs from the page's styles
See
packages/<package-name>/README.md
for more details about the individual packages.
-
@webext-core/content-script-ctx
: Stop content scripts when their context is invalidated -
@webext-core/publish
: A tool for publishing an extension to the various stores
To use an NPM module in a web extension, you'll need to install a bundler and configure it for web extensions. Then install any of the packages from the @webext-core
scope:
# Install a bundler and plugin for building extensions
npm i -D vite vite-plugin-web-extension
# Install a @webext-core package
npm i @webext-core/messaging
npm i @webext-core/storage
npm i -D @webext-core/publish