shushpan / react-browser-extension-boilerplate

πŸŽ‰ React / Preact X browser extension boilerplate for the most popular browsers (Chrome, Firefox, Opera, new Edge and other Chromium-based browsers)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React (Preact) Browser Extension Boilerplate

Documentation Maintenance License: MIT Twitter: el4astero

This project aims to provide a simple boilerplate for writing browser extensions for the most popular browsers, such as Chrome, Firefox, Opera, new Edge and other Chromium-based browsers.

πŸŽ‰ Features

  • Preact X or React (by default Preact - lightweight React alternative)
  • Shadow DOM for injected content
  • CSS Modules
  • PostCSS (preset-env and custom-properties)
  • Auto reloading
  • Ready-to-go setup with internationalization

πŸ“ Description

It's built with preact and preact-compat which allows you to switch between react and preact.

Content and styles which are injected directly to the page, are isolated inside Shadow DOM. CSS modules are used to avoid class names collision.

Example

🏁 Install

git clone git@github.com:ElForastero/react-browser-extension-boilerplate.git <YOUR_PROJECT_NAME>

πŸš€ Usage

yarn watch

Runs webpack in watch mode. Automatically reloads the page after changes in files.

yarn build

Builds the extension in production mode.

⚠️ Note on Content Security Policy (CSP)

"unsafe-eval" in directive 'script-src' is needed for auto reloading, and should be removed from production manifest.json.

πŸ’» Useful links

πŸ‘¨β€πŸ’» Author

πŸ‘€ Eugene Dzhumak

🀝 Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2019 Eugene Dzhumak.
This project is MIT licensed.


This README was generated with ❀️ by readme-md-generator

About

πŸŽ‰ React / Preact X browser extension boilerplate for the most popular browsers (Chrome, Firefox, Opera, new Edge and other Chromium-based browsers)


Languages

Language:JavaScript 81.2%Language:CSS 18.8%