Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use webpack-httpolyglot-server #37

Merged
merged 2 commits into from
May 5, 2016
Merged

Use webpack-httpolyglot-server #37

merged 2 commits into from
May 5, 2016

Conversation

jhen0409
Copy link
Owner

@jhen0409 jhen0409 commented May 3, 2016

This solves the problem of long-standing - Due to injectpage feature, we only use https webpack server in development mode, so you need to allow https connection in any case.

The solution of use webpack-httpolyglot-server

  • Just use http on Window, Popup, Background
  • The publicPath using // as prefix for injectpage bundle, which means it will select protocol of current injectpage. Only when you are in https page, you need to allow https connection.

@jhen0409 jhen0409 force-pushed the webpack-httpolyglot branch 2 times, most recently from 3054381 to 19be989 Compare May 5, 2016 01:33
@jhen0409 jhen0409 merged commit 6b59093 into master May 5, 2016
@jhen0409 jhen0409 deleted the webpack-httpolyglot branch May 5, 2016 15:39
@tommedema
Copy link

tommedema commented May 8, 2016

@jhen0409 this seems to be bugged because of this line:

https://github.com/jhen0409/react-chrome-extension-boilerplate/blob/master/chrome/extension/background/inject.js#L15

You are always requesting the HTTP version of the inject script, and therefore when loading a HTTPS site, the inject script will fail to load.

I tried to use a protocol relative url // but this doesn't seem to work with fetch.

@tommedema
Copy link

Similarly, on https pages inject.jade seems to load from the http protocol. Also, I'm getting this:

Mixed Content: The page at 'https://tweakers.net/' was loaded over HTTPS, but requested an insecure EventSource endpoint 'http://localhost:3000/__webpack_hmr'. This request has been blocked; the content must be served over HTTPS.

@jhen0409
Copy link
Owner Author

jhen0409 commented May 8, 2016

but requested an insecure EventSource endpoint 'http://localhost:3000/__webpack_hmr'. This request has been blocked; the content must be served over HTTPS.

This is a problem for embedded iframe in right-dock, it used TodoApp bundle and always requesting HTTP (because used // will incorrect use chrome-extension:// in Window/Popup), it should not works with hot reload in embedded iframe (inject bundle works), I'm looking for a better way to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants