← 全部工具

extension

热度 65 更新于 开发与构建

The cross-browser extension framework. Build Chrome, Edge, Firefox, and Safari extensions with no build configuration.

npmauto-collected

安装

npm
npm install -g extension

通过 npm 安装。

[npm-version-image]: https://img.shields.io/npm/v/extension.svg?color=0971fe [npm-version-url]: https://www.npmjs.com/package/extension [npm-downloads-image]: https://img.shields.io/npm/dm/extension.svg?color=0971fe [npm-downloads-url]: https://www.npmjs.com/package/extension [stars-image]: https://img.shields.io/github/stars/extension-js/extension.js?style=flat&color=0971fe [stars-url]: https://github.com/extension-js/extension.js/stargazers [action-image]: https://github.com/extension-js/extension.js/actions/workflows/ci.yml/badge.svg?branch=main&color=0971fe [action-url]: https://github.com/extension-js/extension.js/actions [discord-image]: https://img.shields.io/discord/1253608412890271755?label=Discord&logo=discord&style=flat&color=0971fe [discord-url]: https://discord.gg/v9h2RgeTSN [snyk-image]: https://snyk.io/test/github/extension-js/extension.js/badge.svg?color=0971fe [snyk-url]: https://snyk.io/test/github/extension-js/extension.js

Extension.js [![Version][npm-version-image]][npm-version-url] [![Downloads][npm-downloads-image]][npm-downloads-url] [![Stars][stars-image]][stars-url] [![CI][action-image]][action-url] [![Discord][discord-image]][discord-url]

The cross-browser extension framework. Build for Chrome, Edge, Firefox, and Safari with no build config required.

<img alt="Logo" align="right" src="https://avatars.githubusercontent.com/u/172809806" width="20.25%" /

npx extension@latest create my-extension
cd my-extension
npm run dev

Works with npm, pnpm, yarn, bun, and deno.

Documentation · Templates · Examples · Discord

Why Extension.js

Browser extensions ship with the worst dev experience in modern web. Manifest V3 fragmentation, browser-specific quirks, no hot reload for content scripts, and a separate build pipeline for every target. Extension.js fixes that.

  • Hot Module Replacement for background, content, popup, and options scripts, including React, Vue, Svelte, and Preact components
  • Manifest V3 by default, with automatic adapters for Chrome, Edge, Firefox, and Safari targets
  • One CLI for Chrome, Edge, Firefox, and any Chromium or Gecko binary
  • Zero config, no webpack, no rollup, no plugins to maintain
  • First-class TypeScript, React, Vue, Svelte, and Preact support
  • Production builds with extension build --zip, ready for the Chrome Web Store and Firefox Add-ons
  • Drop-in for existing extensions with one devDependency

Watch it work

60-second demo

Or skip the install and try a live template in your browser.

How is this different

If you have used Plasmo, WXT, or CRXJS, here is what Extension.js does that the others do not:

| Capability | Extension.js | | :--------- | :----------- | | Run any GitHub sample directly | extension dev https://github.com/.../sample | | Managed browser binaries | extension install firefox downloads an isolated build | | Cross-browser HMR for content scripts | Built in, no plugin glue | | Production zip for the stores | extension build --zip | | Framework agnostic | Vanilla, TS, React, Vue, Svelte, Preact, no lock-in | | Custom Chromium and Gecko binaries | --chromium-binary, --gecko-binary |

Frameworks