Code Monkey home page Code Monkey logo

web-extension-boilerplate's Introduction

Web Extension Boilerplate



This boilerplate provides a skeleton to start developing cross-browser web extensions.

All Contributors

jest code style: prettier PRs Welcome ci/cd by

Prerequisites

You need to install pnpm

Development

npm install -g pnpm
pnpm i

Chrome

pnpm app:chrome-dev

Edge

pnpm app:edge-dev

Firefox

pnpm app:firefox-dev

Production

pnpm i
pnpm app:chrome

Edge

pnpm app:edge

Firefox

pnpm app:firefox

Load package to browsers

Chrome

  1. Go to the browser's URL address bar
  2. Enter chrome://extensions/
  3. Switch to "Developer mode"
  4. Load extension by clicking "Load unpacked"
  5. Browse to dist/ in source code
  6. Done!

Check here for more detail: https://developer.chrome.com/extensions/getstarted

Edge

  1. Go to the browser's URL address bar
  2. Enter edge://extensions/
  3. Turn on Developer mode
  4. Load extension by clicking "Load unpacked"
  5. Browse to dist/ in source code
  6. Done!

Firefox

  1. Go to the browser's URL address bar
  2. Enter about:debugging#/runtime/this-firefox
  3. Click Load Temporary Add-on...
  4. Browse to your manifest.json & click Open
  5. Done!

Check here for more details: https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/

How to keep devtool appears when developing

Simple, just open chrome extension as a page. To do that, follow below steps:

  1. Open extension management page

Screen Shot 2021-05-27 at 14 44 56

  1. Copy extension id

Screen Shot 2021-05-27 at 14 45 20

  1. Open extension as a page chrome-extension://<extension-id>/popup.html
  • For example: chrome-extension://npjcjlkchmiidojhockoecphakigbaej/popup.html

chrome-extension://npjcjlkchmiidojhockoecphakigbaej/popup.html

Privacy Policy file

Web stores require you to describe what the extension is or if you collect data of users. You also need to describe why you do that.

Make sure you include this file when you publish an extension, the web store may ask you to upload it.

Note: If you don't know how to write a privacy policy file, you can look at the existing one attached on this repository.

Badges

You can add badges to your project to indicate the version or to show how many users use your extension here:

CI/CD with github action

You can modify the .github/workflows to show the CI/CD flow.

How to publish web extension

Browsers Web store
Chrome https://developer.chrome.com/webstore/publish
Microsoft Edge https://docs.microsoft.com/en-us/microsoft-edge/extensions-chromium/publish/publish-extension
Firefox https://extensionworkshop.com/documentation/publish/submitting-an-add-on

References

Showcase

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


David Nguyen

๐Ÿ’ป ๐Ÿ“– ๐ŸŽจ ๐Ÿšง ๐Ÿ‘€ โš ๏ธ

Minh Ngo

๐Ÿ’ป โš ๏ธ

Ben Harned

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

web-extension-boilerplate's People

Contributors

3benlee avatar allcontributors[bot] avatar davidnguyen11 avatar mingo023 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

web-extension-boilerplate's Issues

Add lint-staged and husky

  • Install lint-staged package
  • Install husky package
  • Register lint & prettier npm scripts under lint-staged config in package.json
  • Register pre-commit using husky
  • Register pre-push using husky
  • Uninstall git-hook-plus package & remove .githook dir

Add links to online resources

  • Youtube channel
  • Google group

Describe the experience to developer for easier publishing extension to the store successfully

Replace npm with pnpm

  • Remove package-lock.json
  • Use pnpm to install to generate pnpm-lock.yaml
  • Replace npm run with pnpm <script> in .husky/ package.json (lint-staged)
  • Add .nvmrc to use latest node 18

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.