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.25k stars 116 forks source link

After recent upgrade, GhostText disconnects from editor after 30 seconds #317

Closed nsc-kronberg closed 1 day ago

nsc-kronberg commented 6 days ago

Description and repro

Sometime in the last few days GhostText stopped working properly on both my Linux computers. I suspect it has to do with the recent GhostText update (Firefox says "Last Updated June 30, 2024" for GhostText on about:addons).

The content of the text area appears in my editor (Emacs using https://github.com/alpha22jp/atomic-chrome), and I can edit it, and if I close the editor buffer within 30 seconds everything works normally.

But almost exactly 30 seconds after I click the GhostText button in Firefox, the editor buffer closes (just as if I closed it manually), but GhostText in Firefox appears to still be active (green tickmark on GhostText icon) so I cannot easily enable the editing again without reloading the web page.

The 30s seems to be if the editor is idle. If I type in the editor more or less constantly, I can see the edits in the Firefox text area, and the connection lives for a little longer, around 55 seconds.

This could of course be an Emacs problem, but I tried snooping on the Websocket traffic between Firefox and Emacs using Wireshark, and I can see that Firefox/GhostText sends a "WebSocket Connection Close" packet exactly when Emacs closes the buffer.

I realize Emacs is not officially supported and I have not tested in Chrome, but it seems like a clear regression in GhostText (or maybe something triggered by a recent Firefox update)

Browser(s) tried

Firefox

Editor(s) tried

Emacs

fregante commented 6 days ago

This is a limitation of the new Manifest v3 that Google has been forcing on us. I'll check if I can send a dummy message every 10 seconds to keep the connection alive.

fregante commented 1 day ago

An update is out, but you need Firefox 128+ now since v24.7.1

Wait until July 9th for its release or download the beta now:

https://www.mozilla.org/en-US/firefox/channel/desktop/#beta