I like to scroll through my tabs using J,K. This works fine, until a tab has a highlighted text area, which the browser starts typing into. Next, I have to press Esc and continue with J,K until i encounter the next highlighted text area.
If wanted to type into a text area, I would select it myself using the f key.
Please fix :)
This is a common topic of discussion and one that's debatable. I used to hate the "defocus the page's focused textbox" behavior when I first started using vimperator because it was klunky and surprising, but I too would like to be in command mode by default and not have the webpage wrest control away from Vimium.
I think it would be too jarring to do this by default for new users, but I could be proven wrong. Let's explore making this an option.
One reason I didn't like the auto-defocusing behavior of Vimperator is because it was klunky. A page like google will begin to load, have some delay, and _then_ focus a textbox for you. During that entire period you have to monitor whether a textbox gets autofocused, and then unfocus it, so there's some polling involved and the focused element can flicker.
If we can come up with a smoother implementation I'd love to see it.
How about this:
When switching to a tab the active elements is saved and defocused, after a delay of - let's say - 300ms it gets focused again. When you switch to another tab again it also gets focused.
We don't need to poll this since events already we can use. If the delay is not over yet, the saved elements gets overwritten with the new one and defocused.
When I'm browsing tabs, I will be holding shift + j or k. I say instead of a delay, use the shift key. Once I release the shift key, a page can steal focus. If I am still holding the shift key, a page cannot steal the focus.
Thanks devs for all the hard work on vimium.
Would love to have this one, especially if the UX is well-done. Pull request are welcome!
I think most web sites today will focus the input field in one of these two points: in a script tag immediately following the input tag, or in the domready event. We can probably listen for the domready event and defocus any focused input tags, and potentially poll the page before then and defocus any input tags which have somehow gotten the focus. We stop polling once the domready event is fired.
I assume we can't just listen for bubbled up onfocus events on the document element; if that was possible, that would be the most elegant approach to canceling focus changes while the page is loading.
This would require a bit of experimentation to tune it such that it doesn't feel twitchy.
This implementation plan doesn't cover the case where the focus is stolen after the page has loaded.
I've pushed PR #1282 which implements this.
Is there an issue open for tabs stealing focus when changing tabs?
Pages (like Google) can steal focus when changing tabs.
No, there isn't. There's only an option to prevent the page stealing the focus when first visiting a page.
I get that what you describe is annoying, but an option to grab back the focus when changing tab could be annoying too. E.g. you're composing an email, and jump to another tab to grab some info, and when you jump back your email has lost the focus.
Not sure about this, but... Google doesn't grab the focus for me. Do you have _instant search_ enabled on Google.
So as a user, I think I have these tabs:
|----X---|---Y---|---A---|---Z---|----W---|----W---|----W---|----W---|----W---|
But in reality I have these tabs:
|----X---|---Y---|---Evil Steal focus tab---|---Z---|----W---|----W---|----W---|----W---|----W---|
To transverse from Z to Y, I would "shift, j, j, unshift" Instead, I'm stuck in A.
Tabs should be prevented from stealing focus until I "unshift", release shift.
Most helpful comment
So as a user, I think I have these tabs:
|----X---|---Y---|---A---|---Z---|----W---|----W---|----W---|----W---|----W---|
But in reality I have these tabs:
|----X---|---Y---|---Evil Steal focus tab---|---Z---|----W---|----W---|----W---|----W---|----W---|
To transverse from Z to Y, I would "shift, j, j, unshift" Instead, I'm stuck in A.
Tabs should be prevented from stealing focus until I "unshift", release shift.