react-chrome-extension-boilerplate icon indicating copy to clipboard operation
react-chrome-extension-boilerplate copied to clipboard

Updating outdated library + Supporting page InjectApp without CSP problem.

Open yjiq150 opened this issue 5 years ago • 5 comments

Hi,

I updated major libraries and development environment to avoid CSP (Content Security Policy) problem in InjectApp.

This is kind of major update and lots of things been modified so I'm not sure you will like this updates. However, I made this pull request for people that might have run into the same problems as me and need newer version of Webpack and React.

What's changed?

  • Updated: Webpack 4, React 16 (lint & test utility are updated as well)

  • Updated: separated entry points for window, popup, background, content, and page script.

  • Updated: Script for development has been separated to dev-r and dev-s.

  • Updated: Using standard webpack-dev-server instead of httpolyglot-server.

  • Added: react-intl (localization support)

  • Added: sass support

  • Added: localization structure of Chrome Extension Package

Details on CSP problem

When I develop my Steemit Enhancer Chrome Extension, I run into many problems related to CSP with InjectApp part of your original boilerplate code. I need to inject script into currently opened page's context, but the page itself has its own CSP and http://localhost:3000 is not allowed due to CSP.

Therefore I separated dev script into two pieces (dev-r & dev-s) to avoid CSP restriction. Developers can use dev-r to develop background, window, and popup script which don't need to worry about CSP. If developers want to develop content script and injected page script, which can run into CSP restriction, they can use dev-s.

yjiq150 avatar Jul 15 '18 10:07 yjiq150

It's awesome! I'll back to do more review next few days.

jhen0409 avatar Jul 16 '18 08:07 jhen0409

Awesome, @jhen0409 will you merge it eventually?

razum2um avatar Oct 17 '18 10:10 razum2um

@jhen0409 any chance to merge?

shirshak55 avatar Jan 06 '19 06:01 shirshak55

any updates on this?

mfcastro avatar Mar 02 '19 21:03 mfcastro

are you still support HR module?

frontr-uk avatar Aug 28 '19 23:08 frontr-uk