akhodakivskiy / VimFx

Vim keyboard shortcuts for Firefox
https://addons.mozilla.org/firefox/addon/vimfx
Other
1.41k stars 174 forks source link

Input fields not detected on Nightly 116.0a1 (2023-06-24)+ due to the removal of nsIDOMChromeWindow #996

Closed askii2 closed 1 year ago

askii2 commented 1 year ago

Changeset 669217 removed nsIDOMChromeWindow, causing VimFx to not detect Input fields and prevent correct text typing.

By removing ChromeWindow = Ci.nsIDOMChromeWindow here: https://github.com/akhodakivskiy/VimFx/blob/74615a2e548777b09f64e17c42555dd7930e21c0/extension/lib/vim.coffee#L11 and changing element.ownerGlobal instanceof ChromeWindow toelement.ownerGlobal.isChromeWindow here: https://github.com/akhodakivskiy/VimFx/blob/74615a2e548777b09f64e17c42555dd7930e21c0/extension/lib/vim.coffee#L90-L94 i believe the issue can be fixed.

I edited lib/vim.js inside the xpi file directly, so i don't know if there is any difference when editing the coffeescript source.

girst commented 1 year ago

On Fri, Jun 30, 2023 at 03:12:04PM -0700, askii2 wrote:

Changeset 669217 removed nsIDOMChromeWindow, causing VimFx to not detect Input fields and prevent correct text typing.

By removing ChromeWindow = Ci.nsIDOMChromeWindow here: https://github.com/akhodakivskiy/VimFx/blob/74615a2e548777b09f64e17c42555dd7930e21c0/extension/lib/vim.coffee#L11 and changing element.ownerGlobal instanceof ChromeWindow toelement.ownerGlobal.isChromeWindow here: https://github.com/akhodakivskiy/VimFx/blob/74615a2e548777b09f64e17c42555dd7930e21c0/extension/lib/vim.coffee#L90-L94 i believe the issue can be fixed.

I edited lib/vim.js inside the xpi file directly, so i don't know if there is any difference when editing the coffeescript source.

thanks for the report and doing the work to find the regression! I'll verify it and push a release shortly. vimfx tries to stay compatible with older versions of firefox (if the effort is reasonable), so i'll have to check when isChromeWindow was introduced.

girst commented 1 year ago

can you please try this test build? VimFx.zip - built from this commit: https://git.gir.st/VimFx.git/commitdiff/f26531835181fcbffeaa8f8b8b2e47cb3a6d5759

also, i'm wondering how you managed to install vimfx on fx116 - legacyfox failed for me. that's also fixed in https://git.gir.st/LegacyFox.git/commitdiff/5d37da2468e83a49613da2365f314a7c0c1c8e87 (please try that out as well, if you can). are you using another method of installing vimfx?

askii2 commented 1 year ago

I tested both, all worked normally, thank you.

are you using another method of installing vimfx?

Normally, i use https://github.com/xiaoxiaoflood/firefox-scripts to load legacy extensions (and userChromeJS scripts).

girst commented 1 year ago

Thanks again for your investigation. I've credited you in the changelog file.

https://github.com/akhodakivskiy/VimFx/releases/tag/v0.26.3 out now.