Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Firefox #2425

Closed
mrmr1993 opened this issue Feb 9, 2017 · 13 comments · Fixed by #2426
Closed

Support for Firefox #2425

mrmr1993 opened this issue Feb 9, 2017 · 13 comments · Fixed by #2426

Comments

@mrmr1993
Copy link
Contributor

mrmr1993 commented Feb 9, 2017

Firefox now supports WebExtensions. It would be nice to tweak Vimium to work on Firefox.

This is related to #2076.

So far, I've developed some basic support in my fork:

  • branch no-depreciated-apis changes code using depreciated APIs (which FF will not implement) to use their replacements.
  • branch firefox-compat makes some changes to support Firefox, where the current code does not run correctly.
  • branch firefox-51-compat works around some unimplemented features in FF51, the current release. They are fixed in FF52.

You can use branch firefox-merger to test, which is simply all of these merged into master.

@smblott-github
Copy link
Collaborator

Thanks, @mrmr1993. Reviewing the final branch mentioned above, it looks like the required changes aren't really that disruptive. How complete is this? (I don't have the setup to test this.) I know @philc is interested in adding Firefox support.

@mrmr1993
Copy link
Contributor Author

I probably still need to look at non-normal mode key handling. Other than that, it seems complete, but Firefox isn't.

Some example problem Firefox bugs:

  • disabling a element while it is focused doesn't blur it, and results in (nearly) all key events being suppressed.
    • in practice, this means that we get stuck on the save button in the options page. A .blur() before disabling should fix that, but we can still get stuck on other pages.
    • general escape strategy is [tab][esc], but still bad UX.
  • no support for the clipboard API, which stops several commands working
  • all simulated mouse clicks with modifiers (think opening tabs in foreground/background) do not trigger the default option
    • combined with the clipboard issues, this means that it is difficult to open a link in a new window. (Suggested nasty workaround is fytJH)
  • keypress always fires, so we can't distinguish printing and non-printing keys.

@philc
Copy link
Owner

philc commented Feb 24, 2017

This is really cool; great start @mrmr1993. I would love to get a viable Firefox version out onto the store since the current crop of Vim-style extensions are going to stop working once the classic extension APIs are fully deprecated. Hopefully Firefox support won't incur a large QA/maintenance burden.

I haven't stressed tested it with days of usage, but I will try to. However, there were a couple of things I noticed right away:

  1. Link hints on this bing page appear much slower than on Chrome. It takes between 250ms-1000ms, whereas with Chrome, it's instant. Not sure if that's just poor performance from Firefox, or some bad interaction between our link hints code and Firefox.
  2. I was able to get into a state where I had link hints showing, but ESC didn't dismiss them, and other keys were being registered (e.g. you can use j/k to scroll the page, even though hints are showing). I got here by very quickly toggling between the f and esc keys, although it's not easy to reproduce.

Have you used it much in practice @mrmr1993?

@mrmr1993
Copy link
Contributor Author

Have you used it much in practice @mrmr1993?

I've completely switched from Chrome to Firefox, so I'm using it a lot. There's plenty that isn't working, but my barely-patched version works well enough for my current day to day.

I would love to get a viable Firefox version out onto the store

Is anybody else (interested in) working on this at the moment? I can start actively working on the project again, if not / if it would help.

@gloomy-ghost
Copy link

gloomy-ghost commented Mar 3, 2017

FYI:

https://addons.mozilla.org/en/firefox/addon/vimfx/
There is an addon on amo which is similar with Vimium for Chrome [EDIT: Still using old Addon-SDK though]

https://addons.mozilla.org/en/firefox/addon/vimium/
And a deprecated addon which is also called vimium...

@AnshulMalik
Copy link

AnshulMalik commented Mar 14, 2017

I wish to contribute to this project, making vimium work with firefox :)

@pvinis
Copy link

pvinis commented Mar 29, 2017

how can i actually install from the firefox-merger branch? i would also like to try it out and test it.

@mrmr1993
Copy link
Contributor Author

  • Clone the branch.
  • Install Coffeescript.
  • Run cake build to build.
  • Add the extension temporarily (you'll have to do this each time you start your browser; it's a PITA) from the URL about:debugging, by selecting any file in the folder containing your clone.

@zetok zetok mentioned this issue Apr 15, 2017
@smblott-github
Copy link
Collaborator

@mrmr1993 What's the status of this?

@philc
Copy link
Owner

philc commented Apr 16, 2017

We should probably merge firefox-merger and create a TODO list of gaps between the chrome and firefox version. Once we get to the point where it's ready for wide adoption, we'll get it onto the Firefox addons site.

@mrmr1993
Copy link
Contributor Author

mrmr1993 commented Apr 16, 2017

We should probably merge firefox-merger

I've rebased firefox-compat onto master. To get Vimium working with Firefox, it should be enough to merge firefox-compat-rb (the rebase branch).

@mrmr1993 What's the status of this?

Other things that need fixing, either on our side or on Firefox's:

  • showing the HUD in find mode throws an error (fixed in dfddd54)
  • window.find throws an error on page wrap. (needs more investigation, but e46a369 stops the errors. Also stops the find mode HUD losing focus after calling window.find).
  • open in foreground/background/etc. doesn't work (FF issue 1356309)
  • clipboard API is unsupported (FF issues 1344410)
  • new tab page doesn't open with Chrome-specific URL (2f9beb7 fixes this to support Chrome and FF edit: can't currently find a way to open new tab in FF at all, but about:newtab seems like a more likely candidate going forward. FF issue 1275209.)

This is everything that springs to mind for now.. I'll tidy this up and push a PR.

@mcomella
Copy link

mcomella commented Aug 10, 2017

FYI: it was announced that legacy extensions will stop working in tomorrow's Firefox Nightly so presumably VimFx, Firefox's Vimium counterpart, will also stop working in 57. With a brief skim, it doesn't look like their initiative to switch to WebExtensions is progressing (akhodakivskiy/VimFx#860).

@ronjouch
Copy link

Thanks for the FYI @mcomella. In case it's not clear to passersby, Vimium does work in Firefox 57, see Vimium-FF. I, for one, and coming from VimFx, am happy with its feature set. Thanks Vimium folks 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants