开发者

Lose focus on Embededd/Flash element/tab in Firefox

Without AutoHotkey and Firefox -unfocu开发者_StackOverflows since it's involved in operating another program and it doesn't work on linux and without Restore Window Focus After Flash addon since doesn't give you control over flash tabs.

Did anyone succeeded in implementing this gBrowser.selectedTab.unfocus(); method and bind it to a keystroke in Firefox v3.6 ?

I've also tried (based on the addon above)

if (document.getElementsByTagName("EMBED").length == 0) {
  return;
}

if (document.activeElement.tagName == "EMBED") {
      document.activeElement.blur();
}
return;

But it doesn't work.

Also tried this JS code binded to a keystroke:

var file = Components.classes["@mozilla.org/file/local;1"].
  createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
  createInstance(Components.interfaces.nsIProcess);
var args = ["-unfocus"];
file.initWithPath("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
process.init(file);
process.run(false, args, args.length);

Still no go.


Hi I am the author of unfocus extension.

Generally as far as I now you cannot simply bind keystroke in Firefox to unfocus plugin, because Firefox doesn't have focus. Plugin have full keyboard focus, so to unfocus plugin you must use external application. That's the reason for creating such extension. It's the only way with the most simple implementation.

I run linux and almost every Window Manager I know support keybindings to commands. AutoHotkey is only one of the ways to achieve this on Windows. Because of this I always seen this extension as far more simple for Linux/BSD crowd.

Bind a keystroke to firefox -unfocus command.

If you use metacity (default WM of gnome):

gconf-editor -> / -> apps -> metacity -> global_keybindings and keybinding_commands

If you use kwin (kde):

http://maketecheasier.com/configure-custom-shortcuts-in-kde/2009/09/28

novell.com/coolsolutions/qna/11619.html

If you use xfwm (xfce):

Keyboard Settings -> Shortcuts

If you use openbox (lxde):

http://urukrama.wordpress.com/openbox-guide/#Key_mouse

Note that I don't use previously mentioned WM-s and DE-s, I just searched a little. If you use tiling wm you should already know how to bind a keystroke.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜