The cross-browser extension framework
Extension.js makes it very easy to develop cross-browser extensions.
Developers prefer it for its fast builds, unified interface, and zero configuration setup.
Use the create
command to generate a new extension. Also works with pnpm, yarn, and bun.
npx extension@latest create my-extension
cd my-extension
npm run dev
https://github.com/cezaraugusto/extension/assets/4672033/7263d368-99c4-434f-a60a-72c489672586
ESNext latest |
TypeScript latest |
WASM latest |
React 18+ |
Vue 3+ |
Svelte 5+ |
Preact 10+ |
Angular š |
Solid š |
š = PR Welcome!
Start developing an extension using a sample from Chrome Extension Samples
See the example below where we request the sample page-redder from Google Chrome Extension Samples.
https://github.com/cezaraugusto/extension/assets/4672033/ee221a94-6ec7-4e04-8553-8812288927f1
npx extension@latest dev https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/functional-samples/sample.page-redder --browser=edge
If you have an existing extension which is using a package manager, you can install the Extension.js package and manually create the scripts used to run your extension.
https://github.com/cezaraugusto/extension/assets/4672033/48694a23-b7f1-4098-9c5d-eff49983739c
Step 1 - Install extension as a devDependency
npm install extension@latest --save-dev
Step 2 - Link your npm scripts with the executable Extension.js commands
{
"scripts": {
"build": "extension build",
"dev": "extension dev",
"preview": "extension preview"
},
"devDependencies": {
// ...other dependencies
"extension": "latest"
}
}
Done. You are all set!
npm run dev
.npm run build
.npm run build
and npm run preview
.Chrome browser ā |
Edge browser ā |
Firefox browser ā |
Opera browser āļø |
Safari browser ā |
Chromium-based āļø |
Gecko-based āļø |
Firefox (Android) ā |
Safari (iOS) ā |
Use these flags with extension dev
, extension start
, or extension preview
:
--browser <chrome | edge | firefox>
--chromium-binary <path-to-binary>
--gecko-binary <path-to-binary>
Examples:
# Chrome (system default)
npx extension@latest dev --browser=chrome
# Edge
npx extension@latest dev --browser=edge
# Custom Chrome/Chromium path
npx extension@latest dev --chromium-binary "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Custom Firefox path
npx extension@latest dev --gecko-binary "/Applications/Firefox.app/Contents/MacOS/firefox"
MIT (c) Cezar Augusto and the Extension.js Authors.