react-chrome-extension-boilerplate
react-chrome-extension-boilerplate copied to clipboard
Updating outdated library + Supporting page InjectApp without CSP problem.
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
anddev-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
.
It's awesome! I'll back to do more review next few days.
Awesome, @jhen0409 will you merge it eventually?
@jhen0409 any chance to merge?
any updates on this?
are you still support HR module?