[Pkg-mozext-commits] [adblock-plus-element-hiding-helper] 231/483: Removed view source hack, can use view source window from toolkit in SeaMonkey as well now

David Prévot taffit at moszumanska.debian.org
Thu Jan 22 21:41:44 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 7ba715eb524fbd74b34e44932f333e9c6cb59c1d
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Oct 22 13:10:57 2010 +0200

    Removed view source hack, can use view source window from toolkit in SeaMonkey as well now
---
 modules/Aardvark.jsm | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/modules/Aardvark.jsm b/modules/Aardvark.jsm
index 13d5ae8..ddcf728 100644
--- a/modules/Aardvark.jsm
+++ b/modules/Aardvark.jsm
@@ -51,29 +51,6 @@ Aardvark.start = function(wrapper) {
   if (!wrapper.canSelect())
     return;
 
-  if (!("viewSourceURL" in this)) {
-    // Firefox/Thunderbird and SeaMonkey have different viewPartialSource URLs
-    var urls = [
-      "chrome://global/content/viewPartialSource.xul",
-      "chrome://navigator/content/viewPartialSource.xul"
-    ];
-    this.viewSourceURL = null;
-    for (var i = 0; i < urls.length && !this.viewSourceURL; i++) {
-      var request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIJSXMLHttpRequest);
-      request.open("GET", urls[i], false);
-      try {
-        request.send(null);
-        this.viewSourceURL = urls[i];
-      } catch (e) {}
-    }
-
-    if (!this.viewSourceURL) {
-      for (i = 0; i < this.commands.length; i++)
-        if (this.commands[i] == "viewSourceWindow")
-          this.commands.splice(i--, 1);
-    }
-  }
-
   this.windowWrapper = wrapper;
   this.browser = wrapper.browser;
 
@@ -600,14 +577,14 @@ Aardvark.viewSource = function (elem)
 
 //--------------------------------------------------------
 Aardvark.viewSourceWindow = function(elem) {
-  if (!elem || !this.viewSourceURL)
+  if (!elem)
     return false;
 
   var range = elem.ownerDocument.createRange();
   range.selectNodeContents(elem);
   var selection = {rangeCount: 1, getRangeAt: function() {return range}};
 
-  this.windowWrapper.window.openDialog(this.viewSourceURL, "_blank", "scrollbars,resizable,chrome,dialog=no",
+  this.windowWrapper.window.openDialog("chrome://global/content/viewPartialSource.xul", "_blank", "scrollbars,resizable,chrome,dialog=no",
                                        null, null, selection, "selection");
   return true;
 }

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