GithubHelp home page GithubHelp logo

jketcham / react-chrome-extension-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jhen0409/react-chrome-extension-boilerplate

0.0 2.0 0.0 813 KB

Boilerplate for Chrome Extension React.js project

License: MIT License

JavaScript 85.55% CSS 12.65% HTML 1.80%

react-chrome-extension-boilerplate's Introduction

React Chrome Extension Boilerplate

Build Status Build status: Windows NPM version Dependency Status devDependency Status

Boilerplate for Chrome Extension React.js project.

Features

Examples

The example is edited from Redux TodoMVC example.

Popup

Popup

The todos state will be saved to chrome.storage.local.

Window

Popup

The context menu is created by chrome/app/background/contextMenus.js.

Inject page

The inject script is being run by chrome/app/background/inject.js. A simple example will be inject bottom of page(https://github.com/*) if you visit.

Installation

# clone it
$ npm install

# or npm way
$ npm install react-chrome-extension-boilerplate --dev

Development

  • Run script
# build files to './dev'
# start WebpackDevServer
$ npm run dev
  • Allow https://localhost:3000 connections. (Because injectpage injected GitHub (https) pages, so webpack-dev-server procotol must be https.)
  • Load unpacked extensions with ./dev folder.

React/Redux hot reload

This boilerplate uses Webpack and react-transform, and use Redux. You can hot reload by editing related files of Popup & Window & Inject page.

Using Redux DevTools Extension

You can use redux-devtools-extension on development mode.

Build

# build files to './build'
$ npm run build

Compress

# compress build folder to {manifest.name}.zip and crx
$ npm run build
$ npm run compress -- [options]

Options

If you want to build crx file (auto update), please provide options, and add update.xml file url in [manifest.json](https://developer.chrome.com/extensions/autoupdate#update_url manifest.json).

  • --app-id: your extension id (can be get it when you first release extension)
  • --key: your private key path (default: './key.pem')
    you can use npm run compress-keygen to generate private key ./key.pem
  • --codebase: your crx file url

See autoupdate guide for more information.

Test

# lint
$ npm run lint
# test/app
$ npm test
$ npm test -- --watch  # watch files
# test/e2e
$ npm run build
$ npm run test-e2e

LICENSE

MIT

react-chrome-extension-boilerplate's People

Contributors

jhen0409 avatar zalmoxisus avatar

Watchers

James Cloos avatar Jack Ketcham 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.