[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 296/483: Fixed: Clicking homepage link in About dialog doesn't do anything

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 526d40992962e6504052dca1d87c814d93b0b8fd
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Nov 5 18:55:47 2010 +0100

    Fixed: Clicking homepage link in About dialog doesn't do anything
---
 chrome/content/about.js  | 23 +++++++++++++++++++++++
 chrome/content/about.xul |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/chrome/content/about.js b/chrome/content/about.js
index 0dedd53..d363245 100644
--- a/chrome/content/about.js
+++ b/chrome/content/about.js
@@ -145,3 +145,26 @@ function setExtensionData(name, version, homepage, authors, contributors, transl
 
   E("mainBox").setAttribute("loaded", "true");
 }
+
+function loadInBrowser(url)
+{
+  let windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
+  let enumerator = windowMediator.getZOrderDOMWindowEnumerator(null, true);
+  let abpHooks = null;
+  while (enumerator.hasMoreElements())
+  {
+    let window = enumerator.getNext().QueryInterface(Ci.nsIDOMWindow);
+    abpHooks = window.document.getElementById("abp-hooks");
+    if (abpHooks && abpHooks.addTab)
+      break;
+  }
+
+  if (abpHooks && abpHooks.addTab)
+    abpHooks.addTab(url);
+  else
+  {
+    let protocolService = Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService);
+    let ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+    protocolService.loadURI(ioService.newURI(url, null, null), null);
+  }
+}
diff --git a/chrome/content/about.xul b/chrome/content/about.xul
index 36be8d2..e32109b 100644
--- a/chrome/content/about.xul
+++ b/chrome/content/about.xul
@@ -51,7 +51,7 @@
     </description>
   
     <description id="homepageTitle" value="&homepage.label;"/>
-    <description id="homepage" class="text-link" onclick="Utils.loadInBrowser(this.getAttribute('value'))"/>
+    <description id="homepage" class="text-link" onclick="loadInBrowser(this.getAttribute('value'))"/>
   
     <vbox id="authorsBox" align="top">
       <label id="authorsTitle" control="authors" value="&author.label;"/>

-- 
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