Giter VIP home page Giter VIP logo

orange-chrome-extension's Introduction

React Chrome Extension Boilerplate

Build Status NPM version

Boilerplate for Chrome extension React.js project.

Included

Example

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.

If you want Packaged app, You can edit manifest.{env}.json.

...
  "app": {
    "launch": {
      "local_path": "app.html",
      "container": "panel",
      "width": 800,
      "height": 500
    }
  },
...

and remove browser_action.

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

# required node.js/io.js
# 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

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.

Build

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

Build & Compress

# compress build folder to react-crx.zip & .crx
npm run compress

You can add custom key.pem in build folder.

Test

npm run test-crdv  // start chromedriver
npm test

LICENSE

MIT

orange-chrome-extension's People

Watchers

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