From 9e142cd761ea9b81c54ccd2b353eccdfd05fed6c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 25 Nov 2008 07:46:15 +0000 Subject: [PATCH] Fix issue #18 --- content/liberator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/liberator.js b/content/liberator.js index e59bb8ba..4afd11e5 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -824,8 +824,8 @@ const liberator = (function () //{{{ { let ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); - if (window == ww.activeWindow && document.commandDispatcher.focusedElement && clearFocusedElement) - document.commandDispatcher.focusedElement.blur(); + if (window != ww.activeWindow) + return; // TODO: make more generic try @@ -847,6 +847,8 @@ const liberator = (function () //{{{ if (frame && frame.top == window.content) elem = frame; } + if (clearFocusedElement && document.commandDispatcher.focusedElement) + document.commandDispatcher.focusedElement.blur(); if (elem && (elem != document.commandDispatcher.focusedElement)) elem.focus(); },