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.31k stars 117 forks source link

GhostText stopped working in Firefox 63 #145

Closed ilpssun closed 5 years ago

ilpssun commented 5 years ago

Setup

Browser: Firefox 63.0 (64-bit) Editor: Sublime Text 3.1.1 (Build 3176)

Description

After upgrading from Firefox 62 to Firefox 63, GhostText stopped working. It still works when using Chromium 70. In the console, I can see the following output in Firefox:

Got message: {action: "select-field", tabId: 32}        → ​content.js:39:9
GhostText: selectField()                                → content.js:150:9
GhostText: detector.focusEvent()                        → content.js:154:13
GhostText: reportFieldData()                            → content.js:206:9

The field is highlighted (blue GhostText frame) but nothing else happens.

Any ideas what might be the issue here? What kind of logs/debugging can I contribute to narrow the issue down?

fregante commented 5 years ago

Try this out! https://github.com/GhostText/GhostText/pull/122

ilpssun commented 5 years ago

I've just tried #122 but it still does not seem to work. The difference to the stable release is that the Sublime Text window actives (using nircmd) and the field is highlighted with a yellow border but no file opens for editing. Firefox consoles outputs:

5 elements on the page → content.js:223:2
GhostText: Click on the desired element to activate it or right-click the GhostText icon to stop the connection. → content.js:210:15
will open socket → content.js:107:3 

and ST3 console outputs:

WebSocketServer id: 4
Setting on message handler
Setting on close handler
Start
Listening on: 52265

But as stated no new window opens in ST3.

Also right-click on GhostText icon and choosing “disconnect” does not deactivate the fields.

In Chromium 70, the extension is working (even with multiple fields at once). ST3 console states for a successful edit of a field:

WebSocketServer id: 8
Setting on message handler
Setting on close handler
Start
Listening on: 52473
Bind view with id: 20
Setting on message handler
View with id: 20 closed
Unbind view with id: 20
Stop
Triggering on_close
fregante commented 5 years ago

What page are you testing this on? Does it work for you on this page in a textarea? https://ghosttext.github.io/GhostText/demo/

ilpssun commented 5 years ago

I used https://ghosttext.github.io/GhostText/demo/ for testing and it did not work for any of the fields on that page. (Neither did hastebin.com or other sites I randomly tried.)

Today, I played around with my stable GhostText addon in Firefox and Firefox portable to triage whether this was really a FF63 issue. After many activating, deactivating and restarting Firefox steps, the old plugin now suddenly works again. I don't know why, though :-|

Interestingly, the new branch phoenix-text (from #122) still does not work for the demo page. ST3 tells me in the status bar “GhostText - Connection opened“ but no new file opens. In the ST3 console, it states

WebSocketServer id: 5
Setting on message handler
Setting on close handler
Start
Listening on: 51195

And in Firefox, I now get a different error telling me that access to ws://localhost:51195/ was blocked because of the Content Security Policy of the site (connect-src). It does work on a non-SSL intranet site at my workplace, though.

ilpssun commented 5 years ago

The error about the Content Security Policy is not reproducible in the console after restarting FF – but #122 is still not working. As the stable plugin is working again for me, I think this ticket can be closed.