Welcome to the fast track for developing cross-browser extensions with Extension.js. Whether you're quickly prototyping or working on full-scale development, this guide will help you get started right away.
Start development by using a sample from the Chrome Extension Samples repository. It's a great way to learn best practices and save time.
Note: Replace <sample-name>
with the sample you want to use from Chrome Extension Samples.
Below, we use the page-redder sample from Google Chrome Extension Samples.
Extension.js supports a variety of browsers, including Microsoft Edge. To start an Edge-compatible extension, follow these steps:
Replace <sample-name>
with the sample you want to use.
Below is an example of using the magic8ball sample from Google Chrome Extension Samples and running it on Edge.
You can also adapt Mozilla Add-Ons to run on Edge with Extension.js:
This will fetch a Mozilla Add-On and adapt it for Edge.
Below is an example of fetching the Apply CSS sample from MDN WebExtensions Examples and running it on Edge.
tsconfig.json
file to the root of your project.package.json
.tsconfig.json
with React support will make your project ready for React and TypeScript.extension
package: The extension
package provides a set of commands to help you build, run, and deploy your extension. It also offers a variety of templates to kickstart your project.--browser
flag: The --browser
flag allows you to specify the target browser for your extension. This ensures that your extension is compatible with the browser you're targeting.--polyfill
flag: The --polyfill
flag helps you adapt Mozilla Add-Ons to run on Edge. It fetches the necessary polyfills to ensure compatibility.Start exploring browser extension development with Extension.js by creating your first extension.