Comment 322 for bug 263435

Revision history for this message
In , Boycott-spammers (boycott-spammers) wrote :

I've a couple comments I hope are constructive.

A lot of the proposed solutions seem like a very large development effort (allow the user to set preferences for which hotkeys he wants the browser to keep), or seem highly platform-centric and/or browser centric (CTRL-W should _always_ work). In a world where plugin developers (e.g. developers of flash applications) are trying to target multiple browsers on multiple platforms, suddenly the list of problematic key-combos explodes to include all the important hot keys in all common browsers and on all common platforms.

On the other hand, plugin developers know they must avoid certain gui toolkit key combos like alt-tab or command-tab.

My proposed solution:

Create a SINGLE new hotkey for Firefox which says "please unfocus this embedded object for me". It doesn't really matter what combo it is (how about ESCAPE? ;) This would require that Firefox was at least sniffing the key events, but it would only have to look for a single key combo and so we wouldn't be violating lots of hotkeys plugin developers might wish to use. If escape is too important a key to take, it could be ctrl-alt-f11 or something...

[Unknown] said (in comment #185) that Firefox isn't even getting the key events from the gui toolkit in many cases.. so perhaps that invalidates my suggestion.

If Firefox is entirely unable to sniff the keyboard events on some platforms, I'd argue that perhaps the responsibility is on the plugin developer (Adobe, Sun..) to "play nice" with the browser.

I'd say flash is probably the biggest offender snatching focus, e.g. if you have a youtube video open in a tab and you try to cycle past it (INCREDIBLY frustrating). Adobe and Sun already have to consider myriad security and usability issues. Flash is built to always exit full screen when the escape key is pressed.. this is a rule imposed by flash and is not overrideable by the flash developer. Flash can make javascript calls.. it seems like it'd be trivial to make it call .blur() on it's DOM object when a certain hotkey is pressed (e.g. escape when not in full screen).

I also have found a pretty pitiful work-around which works for me in FF3 on WinXP. When I've focused a flash object, windows shortcuts like ctrl-escape and alt-f4 still work. If you have more than one tab open and you enable the "warn me when closing multiple tabs" option.. you can press alt-f4 and the browser will pop up the warning/confirmation.. you can then hit escape to say "no I didn't actually want to close" and focus has magically been shifted back to Firefox!

I sometimes browse entirely with the keyboard, e.g. living room/tv setting watching youtube videos, wireless mouse's battery is dead or the mouse is otherwise unavailable. Having youtube then hijack focus is pretty frustrating. At least I can escape using the work-around above.