Coder Social home page Coder Social logo

bookmarkists's Introduction

Template for a browser extension

Build a browser extension with React + TypeScript + esbuild. Supporting both Firefox and Chrome.

Basic Usage

Following examples are for yarn. For npm, please translate by yourself.

Build

Firefox:

yarn run build:firefox

With watch mode:

yarn run build:firefox --watch

Enable source map:

yarn run build:firefox --dev

Chrome:

yarn run build:chrome

Build for both browsers:

yarn build

Run with browsers

Firefox:

yarn run run:firefox

Chrome

yarn run run:chrome

Create a package for Firefox (zip)

yarn run package:firefox

To install an unsigned add-on, you must use Firefox Developer Edition and change settings. https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox

Type check

yarn run typecheck

ESLint

yarn run lint

Fix

yarn run lint:fix

Prettier

yarn run format

Customization

Change Add-on ID for Firefox

Edit firefox.json. It looks like ID need to match following format:

  • {<UUID>}
    • e.g. {abac34b6-b4bd-4fc7-af89-6f7d30be386b}
  • <alphanum>@<alphanum>
    • e.g. dummy@dummy

cf. https://stackoverflow.com/questions/45339492/firefox-add-on-id-conventions

Add background_scripts, etc.

Edit build.ts and configure esbuild.

For Japanese users

Here is an article about this template.
https://zenn.dev/htlsne/articles/web-ext-react-esbuild

bookmarkists's People

Contributors

cocoalix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.