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

Problematic site lexin.oslomet.no on Firefox #127

Closed
balta2ar opened this issue Feb 16, 2020 · 24 comments
Closed

Problematic site lexin.oslomet.no on Firefox #127

balta2ar opened this issue Feb 16, 2020 · 24 comments

Comments

@balta2ar
Copy link

There is this online norwegian dictionary that seems to not work well with VimiumC on Firefox:
https://lexin.oslomet.no/#/findwords/message.bokmal-russian

I didn't see any errors in the console. I tried in Chromium, it worked fine. The annoying issue is that "gi" -- focus input box -- stops working on Firefox, which makes me use mouse quite a lot... Do you think you could look into VimiumC behavior on that specific site? Thank you in advance.

@gdh1995
Copy link
Owner

gdh1995 commented Feb 17, 2020

Sorry but I can not reproduce this on Firefox 72 64-bit on Windows 10. Here're some tips to check:

  • Have you added map ** *** to Vimium C's custom key mappings ? If so, maybe some rules have conflicts with gi.
  • If not, have you installed both Vimium-FF and Vimium C ? If so, you may turn off Don't let pages steal the focus in loading on the 2 extensions and try it.
  • If not, please try this: disable all other web-extensions except Vimium C, reload the page, and then test gi on it again

@gdh1995
Copy link
Owner

gdh1995 commented Feb 24, 2020

Recently Vimium C made a small change when parsing custom key mappings: if there's map g ..., then a new Vimium C will disable default g + any key mappings, so gi will trigger g and then i separately (just as said in #123 (comment)).

However, every new Chrome version of Vimium C used to be verified by officers of Chrome Web Store for several days, so maybe you were just using different versions of Vimium C on your Firefox and Chrome.

So does it still not work on Firefox (but work well on Chrome), if you configure a same list of custom key mappings?

@balta2ar
Copy link
Author

balta2ar commented Mar 4, 2020

Have you added map ** *** to Vimium C's custom key mappings

No, my Custom key mappings setting is empty

If not, have you installed both Vimium-FF and Vimium C

No, this is the first time that I hear about Vimium-FF, I don't have it installed

turn off Don't let pages steal the focus in loading

I tried both with and without this option, still doesn't work

not, please try this: disable all other web-extensions except Vimium C, reload the page

did that, no success -- it's the same :(

Just in case, my versions are: Vimium-C 1.80.3, Firefox 73.0.1 (64-bit) (Manjaro linux)

So does it still not work on Firefox (but work well on Chrome), if you configure a same list of custom key mappings?

I'm sorry, I don't have custom mappings... I'm just using default gi to switch to input box.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 5, 2020 via email

@balta2ar
Copy link
Author

balta2ar commented Mar 5, 2020

empty mapping list on chrome/chromium on your system

mapping setting is empty for all of my browsers since I don't use any custom mappings

@gdh1995
Copy link
Owner

gdh1995 commented Mar 6, 2020

Um, what's your keyboard layout? You can test what key events Vimium C gets on this page: http://gdh1995.cn/vimium-c/keyboard-test.html , and please keep Vimium C disabled when doing tests.

@balta2ar
Copy link
Author

balta2ar commented Mar 6, 2020

The page printed this:

  | Event | Code | Key | Modifiers
-- | -- | -- | -- | --
1 | keydown | KeyT | g |  
2 | keypress | KeyT | g |  
3 | keyup | KeyT | g |  
4 | keydown | KeyL | i |  
5 | keypress | KeyL | i |  
6 | keyup | KeyL | i |  

Sorry, I didn't mention, my layout is colemak. What I also noticed is that in Firefox on this site I can't scroll the page with PageUp, PageDown keys, but in Chromium I can. Is it the issue with how the site intercepts the keyboard? Vimium-C could have nothing to do here, but I wonder if I still can do anything to fix the behavior on Firefox.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 6, 2020

I find a case, so, is this what you're facing? :

  • open the page when Vimium C is enabled
  • not trigger Vimium C's commands, but just search a word like "test" at once
  • wait until the result list finishes loading
  • press gi or some keys else like f / o, but Vimium C does nothing.

If it's also what you mentioned above, it's about a logic issue of Firefox (but not on Chrome), which Vimium C's current solution is not prefect. I'll try to fix it in v1.81.

Added: if so, please test this version: vimium_c-1.80.3-firefox-debug-b318ec3.zip

  • unzip the files into an empty folder
  • open about:debugging#/runtime/this-firefox on Firefox manually
  • click the "load extension" button and select the manifest.json

@gdh1995 gdh1995 closed this as completed in 8dfa56d Mar 6, 2020
@gdh1995 gdh1995 reopened this Mar 6, 2020
@gdh1995 gdh1995 added the bug label Mar 6, 2020
@balta2ar
Copy link
Author

balta2ar commented Mar 6, 2020

I've tried the debug version and it fixed the gi issue, thank you so much!

However, as I mentioned above, there is still a problem with PageUp, PageDown keys. They don't work after I do a search, and they also don't work after page load. I noticed that if I search for something, then I press gi and Esc, PageUp/PageDown start working again. I wish I didn't have to do these extra key presses.

Another feature request (please tell me whether I should create a separate issue for that) that I'm missing with such dictionary sites is that when I press gi, the cursor is put into the input field, but almost always my next action is to erase the contents of the input field, so I have to press Ctrl-Backspace or Ctrl-A to clear the input. Would it be possible to add some setting that would automatically select all input (simlate Ctrl-A) after a gi? Or can that be done with a custom mapping?

@gdh1995
Copy link
Owner

gdh1995 commented Mar 7, 2020

a problem with PageUp, PageDown

According to those I've tested, I think this is either a bug of the website, or a bug of Firefox - it still existed even when I disabled Vimium C.

You may add such custom mappings:

map <pagedown> scrollPageDown
map <pageup> scrollPageUp

to Vimium C, to force Vimium C handle PageDown/PageUp keys, though the scrolling behavior is a little different.

Ctrl-A

There has been an option of focusInput for this:

unmap gi
map gi focusInput select="all-line"

Or you may keep gi unchanged, and assign another key sequence to focusInput select="all-line".

If you need to auto-select all text in a multi-line textbox, then focusInput select="all" helps.

@balta2ar
Copy link
Author

balta2ar commented Mar 7, 2020

focusInput

Awesome, thanks for the tip! It saves a lot of keystrokes for me.

One more thing that I just remembered is that gi says There are no inputs to focus if I scroll input box out of the viewport. But it's very inconvenient with this dictionary, because often times I would search for a word, I scroll the page down to read definitions, and then I want to search for another word. Now I have to press extra gg, but if I could only press gi, that would also same me some typing. After all, I know that input box is there on the page. Is it possible for gi to focus on an input that is outside the viewing area?

@gdh1995
Copy link
Owner

gdh1995 commented Mar 7, 2020

You may try some other commands: switchFocus and simBackspace. When you have focused and then blurred an element, Vimium C remembers it, and switchFocus / simBackspace will re-focus it (also scroll the page if needed).

The difference between them is when a text box is focused, simBackspace will "delete current selected text or a character near the cursor", while switchFocus will blur the text box.

@balta2ar
Copy link
Author

balta2ar commented Mar 7, 2020

Maybe I'm doing something wrong, but mapping map gi switchFocus select="all" just focuses an input, but does not select whole input text anymore. It's good that it can focus an input that is off-screen, but select part for some reason stopped working.

@balta2ar
Copy link
Author

balta2ar commented Mar 7, 2020

When you have focused and then blurred an element

Is there a combination of "focusInput" and "switchFocus"? It looks like I need to call focusInput as least once to be able to use switchFocus. Can I activate an input with switchFocus even if it hasn't been active before?

@gdh1995
Copy link
Owner

gdh1995 commented Mar 8, 2020

Currently, switchFocus doesn't support select="all". Maybe I can add this option to switchFocus in a next version.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 11, 2020

Hello, here's a test version whose switchFocus also support the select option:
vimium_c-1.80.3-chrome-0ecf497.zip; vimium_c-1.80.3-firefox-0ecf497.zip.

  • unzip the files into an empty folder
  • if on Chrome, open chrome://extensions/ and enable the "developer mode"
  • if on Firefox, open about:debugging#/runtime/this-firefox manually
  • click the "load extension" button and select the extension folder or manifest.json

@gdh1995
Copy link
Owner

gdh1995 commented Mar 14, 2020

v1.80.1 (same as v1.80.0) has been released on Firefox.

@gdh1995 gdh1995 closed this as completed Mar 14, 2020
@balta2ar
Copy link
Author

I've just updated to 1.81.1 and gg & G stopped working... Firefox 74.0 (64-bit). T works, tried with no custom mappings, both with and without "Ignore layout" option.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 14, 2020

Oh it's #138

@balta2ar
Copy link
Author

Thanks, I've just tried the following mapping: map gi switchFocus select="all", it works. However, there is still a tiny inconvenience. Let me explain my work flow. I open a page and let's assume that the only input box is somewhere below, it's not currently visible. I use the following mappings:

map gI focusInput select="all"
map gi switchFocus select="all"
  1. I have to scroll down to the input to make it visible
  2. I press gI to focus inbox. I type something, press Esc, scroll the page up, inbox is out of view.
  3. Now to focus input I have to press a different combination -- gi.

Is it possible to combine focusInput and switchFocus (with select)? It would be nice to have a command that when called for the first time will find the first input on the page (all the page, not just the visible part, almost like focusInput), and on the second call will focus last active input (like switchFocus).

P.S. Another minor thing is that it's a bit difficult to discover commands. I checked Vimium-C help window, and it's great that all commands are there but help window is not searchable. There is a wiki page in this repo, but it looks like it may be a bit outdated -- it was updated in 2019 last time.

@gdh1995
Copy link
Owner

gdh1995 commented Mar 15, 2020

Combine

Would you try mapping other shorter keys to these commands?

Or I can make switchFocus call focusInput if no "last focused input".

help window is not searchable

The help dialog should be searchable - maybe you need to click "show advanced commands" at the bottom right corner of the dialog first, and then all commands will be searchable.

@gdh1995 gdh1995 reopened this Mar 15, 2020
@balta2ar
Copy link
Author

Or I can make switchFocus call focusInput if no "last focused input".

That would be perfect, I guess. Maybe an option, e.g. map gi switchFocus select="all" fallbackToSwitchFocus searchMode="visibleArea|allPage"

Actually, when I think about it, switchFocus and focusInput are so similar so that they could be a single command but with different operation modes? e.g.
map gi focusInput select="all" searchMode="lastFocused,visibleArea,allPage which will mean that focusInput will try searching for an input in the following order:

  1. Try to focused last active input
  2. Try searching only visible area
  3. Try searching the whole page.

Users will be able to tune searchMode option as they like.

gdh1995 added a commit that referenced this issue Mar 21, 2020
@gdh1995
Copy link
Owner

gdh1995 commented Mar 21, 2020

Hello, here's a test version whose focusInput supports act="last" and act="last-visible":
vimium_c-1.81.3-firefox-f197269.zip (v1.81.4 has been released) .

"last" means to focus a last element if there's one; "last-visible" means to do this only when the last element is still visible in current view area.

  • unzip the files into an empty folder
  • if on Chrome, open chrome://extensions/ and enable the "developer mode"
  • if on Firefox, open about:debugging#/runtime/this-firefox manually
  • click the "load extension" button and select the extension folder or manifest.json

@gdh1995
Copy link
Owner

gdh1995 commented Mar 28, 2020

v1.81.4 has been released, and you may have a try.

@gdh1995 gdh1995 closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants