Coder Social home page Coder Social logo

rahulvramesh / react-chrome-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from satendra02/react-chrome-extension

1.0 0.0 0.0 2.33 MB

chrome extension boilerplate with ReactJs using inject page strategy

Home Page: https://medium.com/@satendra02/create-chrome-extension-with-reactjs-using-inject-page-strategy-137650de1f39

License: MIT License

JavaScript 96.08% CSS 1.24% HTML 2.68%

react-chrome-extension's Introduction

React Chrome Extension

A chrome extension boilerplate project with ReactJs using inject page strategy.

Stop worrying about the configurational challenges to set up the chrome extension, just start writing your components as usual. Read detailed blog

This project is sponsered By Recast Studio

The boilerplate is to quickly create a chrome extension using ReactJs, The motivation behind creating a boilerplate was:

  1. Instead of chrome's ready-made popup, We wanted our own page injected into DOM as a sidebar for better UX.

  2. We wanted to use ReactJs for the Component-based approach, Routing, and its build mechanism.

  3. We need to make sure that the extension CSS should not conflict with the host page styles in any case.

Features

  • Used ReactJs to write chrome extension
  • Injecting extension to host page as content script
  • Utilized the Chrome messaging API
  • Isolated extension CSS using Iframe

Installation

Make sure you have latest NodeJs version installed

Clone repo

git clone https://github.com/satendra02/react-chrome-extension.git

Go to react-chrome-extension directory run

yarn install

Now build the extension using

yarn build

You will see a build folder generated inside [PROJECT_HOME]

To avoid running yarn build after updating any file, you can run

yarn watch

which listens to any local file changes, and rebuilds automatically.

Adding React app extension to Chrome

In Chrome browser, go to chrome://extensions page and switch on developer mode. This enables the ability to locally install a Chrome extension.

Now click on the LOAD UNPACKED and browse to [PROJECT_HOME]\build ,This will install the React app as a Chrome extension.

When you go to any website and click on extension icon, injected page will toggle.

Using SASS

Boilerplate contains sass-loader, so you can use SASS instead of pure CSS in your project. To do so:

  1. Rename src/App.css file to src/App.scss
  2. Change import line in src/app.js from import './App.css'; to import './App.scss';

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/satendra02/react-chrome-extension/. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The repo is available as open source under the terms of the MIT License.

react-chrome-extension's People

Contributors

satendra02 avatar sshulin avatar junjizhi avatar yiziz avatar justinweintraub avatar

Stargazers

Roman avatar Rahul V Ramesh 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.