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

TiddlyWiki multiple active notes #286

Closed holdenrohrer closed 1 year ago

holdenrohrer commented 1 year ago

Setup

Validated in: Browser: Chromium 112.0.5615.49 Editor: Sublime Text Build 4143

But I also validated it in my main setup: Browser: Mozilla Firefox 111.0.1 Editor: vim 9.0

Description

This is a followup on #236 and #285. I just tried the new TiddlyWiki-focused frame updates with web-ext --target=chromium, and it works great for one note, but it cannot sync a second note. I ran into a similar issue when I was writing PR #284, but I suspect the solution is going to be different because, I think, a separate instance of GhostText runs in each iframe?

Reproducibility Steps

  1. Open https://tiddlywiki.com
  2. Start editing one note
  3. Start GhostText
  4. Start editing a second note
  5. Try to start GhostText and select the second note (will not start synching successfully)

Strangely enough, the following steps will start synching two notes?

  1. Open https://tiddlywiki.com
  2. Start editing one note
  3. Start editing a second note
  4. Start GhostText

Next Steps

I want to see if I can diagnose the problem, but I figured I'd post this issue here.

fregante commented 1 year ago

Thanks for the report. This issue is described by the last point here:

In short: GhostText will only be executed once per tab, so if frames are added they can’t be activated.

That “was injected” check actually already runs once per iframe, but only the first result is considered. PR welcome