[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 298/483: Bug 23441 - Links open in an external application on Linux. Also made sure the browser window is focused when a tab is opened there.

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus-element-hiding-helper.

commit 95d4c9b904044fb0ea580c9a2879b0382b8c1bf2
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Sat Nov 6 22:44:56 2010 +0100

    Bug 23441 - Links open in an external application on Linux. Also made sure the browser window is focused when a tab is opened there.
---
 chrome/content/about.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/chrome/content/about.js b/chrome/content/about.js
index d363245..49f8754 100644
--- a/chrome/content/about.js
+++ b/chrome/content/about.js
@@ -150,13 +150,21 @@ function loadInBrowser(url)
 {
   let windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
   let enumerator = windowMediator.getZOrderDOMWindowEnumerator(null, true);
+  if (!enumerator.hasMoreElements())
+  {
+    // On Linux the list returned will be empty, see bug 156333. Fall back to random order.
+    enumerator = windowMediator.getEnumerator(null);
+  }
   let abpHooks = null;
   while (enumerator.hasMoreElements())
   {
     let window = enumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
     abpHooks = window.document.getElementById("abp-hooks");
     if (abpHooks && abpHooks.addTab)
+    {
+      window.focus();
       break;
+    }
   }
 
   if (abpHooks && abpHooks.addTab)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus-element-hiding-helper.git



More information about the Pkg-mozext-commits mailing list