Giter Site home page Giter Site logo

jeffgca / browser-extension-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fregante/browser-extension-template

0.0 0.0 0.0 278 KB

πŸ“• Barebones boilerplate with webpack, options handler and auto-publishing

JavaScript 39.05% CSS 29.53% HTML 31.42%

browser-extension-template's Introduction

browser-extension-template

Barebones boilerplate with Parcel 2, options handler and auto-publishing.

Sample extension output

Features

How to use this template

Click Use this template and make a copy of your own. πŸ˜‰

Configuration

The extension doesn't target any specific ECMAScript environment or provide any transpiling by default. The extensions output will be the same ECMAScript you write. This allows us to always target the latest browser version, which is a good practice you should be following.

Parcel 2

Being based on Parcel 2 and its WebExtension transformer, you get all the good parts:

  • Browserlist-based code transpiling (which defaults to just the latest Chrome and Firefox versions)
  • Automatically picks up any new file specified in manifest.json
  • Adding TypeScript support is as easy as renaming your files to .ts; sindresorhus/tsconfig is also advised in that case.

Auto-syncing options

Options are managed by fregante/webext-options-sync, which auto-saves and auto-restores the options form, applies defaults and runs migrations.

Publishing

It's possible to automatically publish to both the Chrome Web Store and Mozilla Addons at once by adding these secrets on GitHub Actions:

  1. CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN from Google APIs.
  2. WEB_EXT_API_KEY, and WEB_EXT_API_SECRET from AMO.

Also include EXTENSION_ID in the secrets (how to find it) and add Mozilla’s gecko.id to manifest.json.

The GitHub Actions workflow will:

  1. Build the extension
  2. Create a version number based on the current UTC date time, like 19.6.16 and sets it in the manifest.json
  3. Deploy it to both stores

Auto-publishing

Thanks to the included GitHub Action Workflows, if you set up those secrets in the repo's Settings, the deployment will automatically happen:

  • on a schedule, by default every week (but only if there are any new commits in the last tag)
  • manually, by clicking "Run workflow" in the Actions tab.

Credits

Extension icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.

Extensions created using this template

License

This browser extension template is released under CC0 and mentioned below. There is no license file included in here, but when you clone this template, you should include your own license file for the specific license you choose to use.

CC0

browser-extension-template's People

Contributors

fregante avatar notlmn avatar austince avatar filips123 avatar jeffgca avatar maskys avatar spookyuser 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.