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

Using older version of GhostText in Firefox #202

Closed llinfeng closed 3 years ago

llinfeng commented 3 years ago

By the way, is there an archive of older versions for the Firefox add-on? The versions on this page seem incomplete?

I see myself doing one-off edits mostly, where I only need one input field to activate. When I am done editing, it helps to disconnect GhostText add-on to keep all things back to normal. By now, I may have talked myself to vote for an extra option for a "toggle mode": when activated, the "Connect to GhostText" shortcut does two things below,

  1. When there is no connection, activate all the candidate fields and wait for a mouseclick
  2. When there is an existing connection, disconnect.

If I may recall, is this how GhostText has been working for years? However, I cannot find a newer version between December 2017 and Feb 2021 on the Firefox add-on page. The latest version back in 2017 is Version 17.12.11.910, and it does not allow me to assign a keyboard shortcut to "toggle" the add-on. I'll post a short Autohotkey script if I shall manage to assign a shortcut by clicking on the ghost-icon.


Here is some AHK script that looks for this tiny icon and moves the mouse onto it. To trigger it, use Gosub, icon_search_GhostTextFirefox.

icon_search_GhostTextFirefox:
    CoordMode, Pixel, Screen  
    CoordMode, Mouse, Screen 
    MouseGetPos, xpos, ypos
    ; Note, for now, the search canvas is 5600 pixels wide and 2000 pixels tall
    ImageSearch, FoundX, FoundY, 0, 0, 5600, 2000,  icon_library\GhostText_firefox.png
    ; Update the cursor location by a few more pixels
    FoundX := FoundX + 20
    FoundY := FoundY + 14
    sleep 50
    if (ErrorLevel = 2)
        MsgBox Could not conduct the search.
    else if (ErrorLevel = 1)
        MsgBox Did not find such button.
    else
        ; Main actions: move the mouse and click on the icon
        MouseMove, %FoundX%, %FoundY%
        Click
        ; Pause for 1 second, where a right-click can be issued to show the option "Disconnect GhostText on this page"
        sleep 1000
        ; Restore the mouse to where it was.
        MouseMove, xpos, ypos
return

Originally posted by @llinfeng in https://github.com/fregante/GhostText/issues/178#issuecomment-784740025

fregante commented 3 years ago

Version 17.x is the last version until 21.x. Firefox does remove older versions from their store but there hasn’t been anything significant in between.

And yes until 17.x, GhostText only worked on one field, so if a field was already connected, clicking the button would close the connection.

You shouldn’t need AHK since GhostText comes with its own keyword shortcut. Refer to https://ghosttext.fregante.com

llinfeng commented 3 years ago

Thank you for clarifying. I toyed with version 17.x last night and found it a bit clunky (some field I edited remained highlighted after I close/disconnect the Firefox add-on).

With 21.x, until we have a shortcut to "disconnect", the AHK snippet may help avoid performing the mouse maneuver. I have a separate button on the keyboard for right-clicking. When the mouse moved to the GhostText icon, I can trigger that "Disconnect GhostText on this page" menu entry with the keyboard alone.

fregante commented 3 years ago

Ah that makes sense.

Yeah versions until 21.x were pretty buggy