[Pkg-mozext-commits] [firebug] 01/09: #8004 Firebug icon not showing in Address bar in Firefox browser

David Prévot taffit at moszumanska.debian.org
Sat Apr 2 01:40:37 UTC 2016


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

taffit pushed a commit to branch master
in repository firebug.

commit 00ed9f15e1d752c7f90ddaf60ca856c03fb16946
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Fri Mar 25 15:21:35 2016 +0100

    #8004 Firebug icon not showing in Address bar in Firefox browser
---
 .../content/firebug/firefox/browserOverlay.js      | 11 ++----
 extension/content/firebug/lib/channel.js           | 46 ++++++++++++++++++++++
 extension/content/firebug/lib/http.js              | 14 ++-----
 extension/content/firebug/net/sourceCache.js       | 16 ++------
 extension/content/firebug/net/tabCache.js          | 13 ++----
 5 files changed, 61 insertions(+), 39 deletions(-)

diff --git a/extension/content/firebug/firefox/browserOverlay.js b/extension/content/firebug/firefox/browserOverlay.js
index 81380e6..e4c2a52 100644
--- a/extension/content/firebug/firefox/browserOverlay.js
+++ b/extension/content/firebug/firefox/browserOverlay.js
@@ -14,9 +14,10 @@ define([
     "firebug/firefox/browserToolbar",
     "firebug/lib/system",
     "firebug/lib/devtools",
+    "firebug/lib/channel",
 ],
 function(FBTrace, Options, Locale, Events, Arr, Str, Xpcom, BrowserOverlayLib,
-    BrowserCommands, BrowserMenu, BrowserToolbar, System, DevTools) {
+    BrowserCommands, BrowserMenu, BrowserToolbar, System, DevTools, Channel) {
 
 // ********************************************************************************************* //
 // Constants
@@ -38,7 +39,6 @@ Locale.registerStringBundle("chrome://firebug/locale/multiprocess-notification.p
 Cu.import("resource://firebug/loader.js");
 Cu.import("resource://firebug/fbtrace.js");
 Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
 
 var servicesScope = {};
 Cu.import("resource://gre/modules/Services.jsm", servicesScope);
@@ -446,15 +446,10 @@ BrowserOverlay.prototype =
     getVersion: function()
     {
         var versionURL = "chrome://firebug/content/branch.properties";
-        var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
 
         var loadingPrincipal = servicesScope.Services.scriptSecurityManager.getSystemPrincipal();
 
-        var channel = NetUtil.newChannel({
-            uri: versionURL,
-            loadUsingSystemPrincipal: true
-        });
-
+        var channel = Channel.new(versionURL);
         var input = channel.open();
         var sis = Cc["@mozilla.org/scriptableinputstream;1"].
             createInstance(Ci.nsIScriptableInputStream);
diff --git a/extension/content/firebug/lib/channel.js b/extension/content/firebug/lib/channel.js
new file mode 100644
index 0000000..1139e42
--- /dev/null
+++ b/extension/content/firebug/lib/channel.js
@@ -0,0 +1,46 @@
+/* See license.txt for terms of usage */
+
+define([
+],
+function() {
+
+"use strict";
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+var appInfo = Cc["@mozilla.org/xre/app-info;1"]
+    .getService(Ci.nsIXULAppInfo);
+var versionComparator = Cc["@mozilla.org/xpcom/version-comparator;1"]
+    .getService(Ci.nsIVersionComparator);
+var fx47OrEarlier = (versionComparator.compare(appInfo.version, "47a1") < 0);
+
+const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
+
+Cu.import("resource://gre/modules/NetUtil.jsm");
+
+// ********************************************************************************************* //
+// Module
+
+var Channel = {};
+
+Channel.new = function(url)
+{
+    if (fx47OrEarlier)
+    {
+        return ioService.newChannel(url, null, null);
+    }
+    else
+    {
+      return NetUtil.newChannel({
+          uri: url,
+          loadUsingSystemPrincipal: true
+      });
+    }
+}
+
+return Channel;
+
+// ********************************************************************************************* //
+});
diff --git a/extension/content/firebug/lib/http.js b/extension/content/firebug/lib/http.js
index d165aa9..80bf39b 100644
--- a/extension/content/firebug/lib/http.js
+++ b/extension/content/firebug/lib/http.js
@@ -5,9 +5,10 @@ define([
     "firebug/lib/trace",
     "firebug/lib/deprecated",
     "firebug/debugger/stack/stackFrame",
-    "firebug/lib/string"
+    "firebug/lib/string",
+    "firebug/lib/channel",
 ],
-function(Xpcom, FBTrace, Deprecated, StackFrame, Str) {
+function(Xpcom, FBTrace, Deprecated, StackFrame, Str, Channel) {
 
 "use strict";
 
@@ -20,9 +21,6 @@ const Cr = Components.results;
 const Cu = Components.utils;
 
 const NS_SEEK_SET = Ci.nsISeekableStream.NS_SEEK_SET;
-const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
-
-Cu.import("resource://gre/modules/NetUtil.jsm");
 
 var Http = {};
 
@@ -99,11 +97,7 @@ Http.getResource = function(aURL, ignoreMissing)
 {
     try
     {
-        var channel = NetUtil.newChannel({
-            uri: aURL,
-            loadUsingSystemPrincipal: true
-        });
-
+        var channel = Channel.new(aURL);
         var input = channel.open();
 
         return Http.readFromStream(input);
diff --git a/extension/content/firebug/net/sourceCache.js b/extension/content/firebug/net/sourceCache.js
index 30032f3..4704da8 100644
--- a/extension/content/firebug/net/sourceCache.js
+++ b/extension/content/firebug/net/sourceCache.js
@@ -8,9 +8,10 @@ define([
     "firebug/lib/url",
     "firebug/lib/http",
     "firebug/lib/options",
-    "firebug/lib/string"
+    "firebug/lib/string",
+    "firebug/lib/channel"
 ],
-function(EventSource, Obj, Firebug, Xpcom, Url, Http, Options, Str) {
+function(EventSource, Obj, Firebug, Xpcom, Url, Http, Options, Str, Channel) {
 
 // ********************************************************************************************* //
 // Constants
@@ -19,15 +20,12 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-const nsIIOService = Ci.nsIIOService;
 const nsIRequest = Ci.nsIRequest;
 const nsICachingChannel = Ci.nsICachingChannel;
 const nsIScriptableInputStream = Ci.nsIScriptableInputStream;
 const nsIUploadChannel = Ci.nsIUploadChannel;
 const nsIHttpChannel = Ci.nsIHttpChannel;
 
-const IOService = Cc["@mozilla.org/network/io-service;1"];
-const ioService = IOService.getService(nsIIOService);
 const ScriptableInputStream = Cc["@mozilla.org/scriptableinputstream;1"];
 const chromeReg = Xpcom.CCSV("@mozilla.org/chrome/chrome-registry;1", "nsIToolkitChromeRegistry");
 
@@ -36,8 +34,6 @@ const LOAD_BYPASS_LOCAL_CACHE_IF_BUSY = nsICachingChannel.LOAD_BYPASS_LOCAL_CACH
 
 const NS_BINDING_ABORTED = 0x804b0002;
 
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
 // ********************************************************************************************* //
 
 Firebug.SourceCache = function(context)
@@ -218,11 +214,7 @@ Firebug.SourceCache.prototype = Obj.extend(new EventSource(),
         var channel;
         try
         {
-            channel = NetUtil.newChannel({
-                uri: url,
-                loadUsingSystemPrincipal: true
-            });
-
+            channel = Channel.new(url);
             channel.loadFlags |= LOAD_FROM_CACHE | LOAD_BYPASS_LOCAL_CACHE_IF_BUSY;
 
             if (method && (channel instanceof nsIHttpChannel))
diff --git a/extension/content/firebug/net/tabCache.js b/extension/content/firebug/net/tabCache.js
index 38e5955..ceac597 100644
--- a/extension/content/firebug/net/tabCache.js
+++ b/extension/content/firebug/net/tabCache.js
@@ -18,9 +18,11 @@ define([
     "firebug/trace/traceListener",
     "firebug/net/sourceCache",
     "firebug/lib/options",
+    "firebug/lib/channel",
 ],
 function(ActivableModule, Obj, Firebug, Xpcom, HttpRequestObserver, HttpResponseObserver, Locale,
-    Events, Url, Http, Str, Win, JSONViewerModel, TraceModule, TraceListener, SourceCache, Options) {
+    Events, Url, Http, Str, Win, JSONViewerModel, TraceModule, TraceListener, SourceCache,
+    Options, Channel) {
 
 // ********************************************************************************************* //
 // Constants
@@ -29,10 +31,6 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
-
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
 // List of text content types. These content-types are cached.
 var contentTypes =
 {
@@ -443,10 +441,7 @@ Firebug.TabCache.prototype = Obj.extend(SourceCache.prototype,
             if (url === "<unknown>")
                 return [Locale.$STR("message.sourceNotAvailableFor") + ": " + url];
 
-            var channel = NetUtil.newChannel({
-                uri: url,
-                loadUsingSystemPrincipal: true
-            });
+            var channel = Channel.new(url);
 
             // These flag combination doesn't repost the request.
             channel.loadFlags = Ci.nsIRequest.LOAD_FROM_CACHE |

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list