fregante / GhostText

👻 Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.33k stars 114 forks source link

HTTPS support for Chrome 36+ #5

Closed fregante closed 10 years ago

fregante commented 10 years ago

I tried doing exactly what you did in the video, but when clicking in the textarea nothing happens. This appears Chrome's console:

[blocked] The page at 'https://github.com/bfred-it/Sapere.it-Mobile/edit/master/action.js' was loaded over HTTPS, but ran insecure content from 'ws://localhost:1337/': this content should also be loaded over HTTPS. Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Cacodaimon commented 10 years ago

Hi,

I can't reproduce the error with Chrome 31.0 and Chromium 35.0 on Linux, which Chrome Version are you using and which OS?

fregante commented 10 years ago

I meant to specify it but I forgot!

Version 36.0.1985.32 beta on OS X, even in an empty Chrome profile:

 [blocked] The page at 'https://github.com/Cacodaimon/SublimeTextArea/issues/5' was loaded over HTTPS, but ran insecure content from 'ws://localhost:1337/': this content should also be loaded over HTTPS.

 Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. 
Cacodaimon commented 10 years ago

This behavior seems to be new in Chrome 36: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/1mK3SxfuzqU For now --disable-web-security should fix it, I hope they reconsider this behavior for the localhost…

fregante commented 10 years ago

Yep, that worked! I enabled Allow insecure WebSocket from https origin in chrome://flags

The problem kind of remains for everyone else though, we might try to alert the user if there is a security error.

Cacodaimon commented 10 years ago

Thx, if this behavior still remains in Chrome 36 (No Beta), it might help moving the WebSocket communication from the content.js to the background.js or popup.js (as last opportunity) and let the content.js communicate through a message channel with the background.js…

Cacodaimon commented 10 years ago

I moved the Issue to the Chrome plugin project: https://github.com/Cacodaimon/GhostTextForChrome/issues/1