abhijithvijayan / web-extension-starter

πŸ–₯πŸ”‹Web Extension starter to build "Write Once Run on Any Browser" extension
MIT License
1.97k stars 169 forks source link
boilerplate chrome chrome-extension chrome-extension-react cross-browser edge extension firefox firefox-addon hacktoberfest opera-extension react-extension reactjs sass starter typescript web web-extension-starter web-extensions webpack4

πŸš€ web-extension-starter

Web Extension starter to build "Write Once Run on Any Browser" extension

Travis Build DEPENDENCIES LICENSE TWEET

πŸ™‹β€β™‚οΈ Made by @abhijithvijayan

Donate: PayPal, Patreon

Buy Me a Coffee


❀️ it? ⭐️ it on GitHub or Tweet about it.

πŸ§™β€β™‚οΈ React + TypeScript = This branch

😨 React + JavaScript = Checkout react-javascript branch

πŸ‘ΆπŸΌ HTML + JavaScript = Checkout master branch

Features

Browser Support

Chrome Firefox Opera Edge Yandex Brave vivaldi
49 & later βœ” 52 & later βœ” 36 & later βœ” 79 & later βœ” Latest βœ” Latest βœ” Latest βœ”

Used by extensions in production that has over 100,000+ users.

and many more...

Use this template

Create a new directory and run

curl -fsSL https://github.com/abhijithvijayan/web-extension-starter/archive/react-typescript.tar.gz | tar -xz --strip-components=1

πŸš€ Quick Start

Ensure you have

Then run the following:

Development

Production

Note: By default the manifest.json is set with version 0.0.0. The webpack loader will update the version in the build with that of the package.json version. In order to release a new version, update version in package.json and run script.

If you don't want to use package.json version, you can disable the option here.

Generating browser specific manifest.json

Update source/manifest.json file with browser vendor prefixed manifest keys

{
  "__chrome__name": "SuperChrome",
  "__firefox__name": "SuperFox",
  "__edge__name": "SuperEdge",
  "__opera__name": "SuperOpera"
}

if the vendor is chrome this compiles to:

{
  "name": "SuperChrome",
}

Add keys to multiple vendors by separating them with | in the prefix

{
  __chrome|opera__name: "SuperBlink"
}

if the vendor is chrome or opera, this compiles to:

{
  "name": "SuperBlink"
}

See the original README of wext-manifest-loader package for more details

Bugs

Please file an issue here for bugs, missing documentation, or unexpected behavior.

Linting & TypeScript Config

License

MIT Β© Abhijith Vijayan