Open Bug 1158662 Opened 11 years ago Updated 3 years ago

Forward slash hotkey ("/") does not always work on pages that are fully loaded.

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

37 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: zanetu, Unassigned)

References

()

Details

(Keywords: reproducible, Whiteboard: [INVALID?])

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 Build ID: 20150415140819 Steps to reproduce: (Optional) Disable all extensions and open a new private window. 1. Sign in at youtube.com . 2. Go to https://www.youtube.com/all_comments?v=TllPrdbZ-VI . 3. Wait for page to be fully loaded. 4. Press forward slash key ("/"). Another example: (Optional) Disable all extensions and open a new private window. 1. Go to http://tieba.baidu.com/f?kw=mozilla . 2. Wait for page to be fully loaded. 3. Press forward slash key ("/"). Actual results: Nothing. Expected results: Quick find bar shows up at the bottom.
Component: Untriaged → Keyboard: Navigation
Product: Firefox → Core
(In reply to Gingerbread Man from comment #1) > Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 > Version: 37.0.2 > > Works for me. > > Do you have Flash Player installed and enabled by any chance? If so, in the > Add-ons Manager, Plugins category, set Shockwave Flash to “Never Activate” > then retest the pages. > > If the result is the same, also check if there's a difference in a brand new > profile. > https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox- > profiles I don't have Flash Player installed. A brand new profile yields the same result. Did you sign in at youtube.com before visiting https://www.youtube.com/all_comments?v=TllPrdbZ-VI ? When I am not signed in, the slash key works fine on the page above. It fails only after I sign in.
Flags: needinfo?(zanetu)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0 Version: 37.0.2 Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0 Version: 37.0.2 on Linux Mint KDE 17.1 Something was preventing cookies from being stored. It's been sorted. I can now reproduce the issue. Conversely, without cookies, I can't reproduce the issue on Baidu. I'm inclined to think this is a website problem. For example, 1. https://www.youtube.com 2. Click an empty area of the page to take focus away from the page's search bar. 3. Press / Expected results: Firefox's quick find bar opens. Actual results: YouTube's search bar is focused. Websites overriding keyboard shortcuts isn't a bug. Websites failing to assign keyboard shortcuts to anything useful is also not a browser bug — that may be what's going on here.
Keywords: reproducible
OS: Unspecified → All
Hardware: Unspecified → All
Whiteboard: [INVALID?]
This can be a website issue, but test results on my computer suggest it can also be a browser bug. Try the workflow below. 1. Install Greasemonkey: http://addons.mozilla.org/firefox/addon/greasemonkey/ 2. Install http://greasyfork.org/scripts/9561 3. Sign in at youtube. 4. Visit https://www.youtube.com 5. Wait for page to be fully loaded. 6. Click an empty area of the page to take focus away from the page's search bar. 7. Press forward slash key ("/"). 8. Visit https://www.youtube.com/all_comments?v=TllPrdbZ-VI 9. Wait for page to be fully loaded. 10. Press forward slash key ("/"). 11. Sign out at youtube. 12. Visit https://www.youtube.com/all_comments?v=TllPrdbZ-VI 13. Wait for page to be fully loaded. 14. Press forward slash key ("/"). Results after Step 7: Expected & Actual: Quick search bar popped up and console output: "keydown bubbles up to document: 191" "keydown bubbles up to window: 191" "keypress bubbles up to document: 47" "keypress bubbles up to window: 47" "keyup bubbles up to document: 191" "keyup bubbles up to window: 191" In other words, Firefox captured key events. Results after Step 10: Expected: Quick search bar popped up. Actual: Quick search bar didn't pop up and console output: "keydown bubbles up to document: 191" "keydown bubbles up to window: 191" "keypress bubbles up to document: 47" "keypress bubbles up to window: 47" "keyup bubbles up to document: 191" "keyup bubbles up to window: 191" In other words, Firefox should have captured key events but it didn't. Results after Step 14: Expected & Actual: Quick search bar popped up and console output: "keydown bubbles up to document: 191" "keydown bubbles up to window: 191" "keypress bubbles up to document: 47" "keypress bubbles up to window: 47" "keyup bubbles up to document: 191" "keyup bubbles up to window: 191" In other words, Firefox captured key events.
In a previous comment, the following is posted: "Websites overriding keyboard shortcuts isn't a bug." I am not expert enough to say if this reflects proper policy or not. I do know that when a web site does something silly (like youtube abusing the slash key), it would be nice if Firefox (or an addon like GreaseMonkey) offered a simple way of preventing said silliness. Zane Tu offers an excellent GreaseMonkey solution in the "Browser Key Test" script that he links to above. At it's core, we see: > var EVENT_TYPES = ['keydown', 'keyup', 'keypress'] > var ael = EventTarget.prototype.addEventListener > EventTarget.prototype.addEventListener = function(type) { > for(var i = EVENT_TYPES.length - 1; i >= 0; i--) { > if(type == EVENT_TYPES[i]) { > return > } > } > ael.apply(this, arguments) > } This basically lets GreaseMonkey prevent a silly site from being able to listen to key events in JS. I like this solution and think it should work on youtube (it works on other sites). So, to rephrase, maybe it's not a bug that silly sites can be silly, but it is very unfortunate (a bug?) that GreaseMonkey (which can run its JS before the site can) does not have the ability to prevent such silliness. For me, the best feature of Firefox is its flexibility. I hope this gets fixed so that we can preserve/extend that flexibility with regard to preventing unwanted keyboard shortcut abuse by "not evil" websites. See also: # "Take back the '/' key from google groups using greasemonkey" http://stackoverflow.com/questions/29732741 The above discussion shows that the GreaseMonkey technique (seen above) works for google groups (with a test link) but not for youtube. # "Slash Preserver (slashpreserver)" # "Firefox addon that prevents JS from hijacking the slash key" http://github.com/perkint/slashpreserver The above is a kludge I wrote as a work-around for this bug...
Component: Keyboard: Navigation → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.