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

Pass full URL to editor for major mode detection #212

Open mbunkus opened 2 years ago

mbunkus commented 2 years ago

Setup

Browser: Chrome, Vivaldi Editor: Emacs

Description

I'm trying out GT with atomic-chrome in Emacs. Unfortunately matching the major mode against host names isn't enough for me. Emacs is my primary tool at work, and we run all of our web services through a single reverse proxy, meaning all of them share the same host name. A lot of those require different major modes: a ticketing system (text-mode), a wiki (dokuwiki-mode), a local Gitlab instance (markdown-mode), our ERP system (a custom-made, ERP-specific major mode) etc.

Coming from the "Edit with Emacs" extension I could handle all of them just fine as Emacs had access to the full URL. With GT this is impossible and highly annoying. Detecting the major mode from the contents doesn't work either as a lot of the time there is no initial content.

So please consider a way to provide the full URL or at least the path, too (meaning up to ?; that would definitely suffice for me). Thanks.

jamesramsay commented 2 years ago

I noticed this too while implementing a server according to the protocol which says url is a URL. Currently the extension only sends the host (e.g. gitlab.com).

I have only tested Chrome with GhostText 21.4.8.