[Pkg-mozext-commits] [requestpolicy] 155/280: [refact] some cleanup for Gecko < 13
David Prévot
taffit at moszumanska.debian.org
Sat May 2 20:30:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository requestpolicy.
commit a673ab77956c1f4cc9e778559ef44446f101a29e
Author: Martin Kimmerle <dev at 256k.de>
Date: Sun Jan 18 19:29:37 2015 +0100
[refact] some cleanup for Gecko < 13
---
src/content/lib/prefs.jsm | 9 ++-------
src/content/ui/overlay.js | 18 ++++--------------
2 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/src/content/lib/prefs.jsm b/src/content/lib/prefs.jsm
index d839cf2..766f5a5 100644
--- a/src/content/lib/prefs.jsm
+++ b/src/content/lib/prefs.jsm
@@ -102,13 +102,8 @@ let Prefs = (function() {
}
self.isPrefetchEnabled = function() {
- // network.dns.disablePrefetch only exists starting in Firefox 3.1
- try {
- return rootPrefBranch.getBoolPref("network.prefetch-next")
- || !rootPrefBranch.getBoolPref("network.dns.disablePrefetch");
- } catch (e) {
- return rootPrefBranch.getBoolPref("network.prefetch-next");
- }
+ return rootPrefBranch.getBoolPref("network.prefetch-next")
+ || !rootPrefBranch.getBoolPref("network.dns.disablePrefetch");
};
function isPrefEmpty(pref) {
diff --git a/src/content/ui/overlay.js b/src/content/ui/overlay.js
index e5586a4..a068102 100644
--- a/src/content/ui/overlay.js
+++ b/src/content/ui/overlay.js
@@ -32,9 +32,10 @@ requestpolicy.overlay = (function() {
const Cc = Components.classes;
const Cu = Components.utils;
- let {ScriptLoader} = (function() {
+ let {ScriptLoader, XPCOMUtils} = (function() {
let mod = {};
Cu.import("chrome://requestpolicy/content/lib/script-loader.jsm", mod);
+ Cu.import("resource://gre/modules/XPCOMUtils.jsm", mod);
return mod;
}());
@@ -893,23 +894,12 @@ requestpolicy.overlay = (function() {
requestpolicy.overlay
._updateBlockedContentState(gBrowser.selectedBrowser);
},
- // Though unnecessary for Gecko 2.0, I'm leaving in onSecurityChange for
- // SeaMonkey because of https://bugzilla.mozilla.org/show_bug.cgi?id=685466
- onSecurityChange : function() {
- },
- QueryInterface : function(aIID) {
- if (aIID.equals(Components.interfaces.nsIWebProgressListener)
- || aIID.equals(Components.interfaces.nsISupportsWeakReference)
- || aIID.equals(Components.interfaces.nsISupports))
- return this;
- throw Components.results.NS_NOINTERFACE;
- }
+ QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener",
+ "nsISupportsWeakReference"])
};
// https://developer.mozilla.org/en/Code_snippets/Progress_Listeners
- // "Starting in Gecko 2.0, all events are optional. The tabbrowser only
- // notifies you of the events for which you provide a callback."
gBrowser.addProgressListener(self.locationListener);
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git
More information about the Pkg-mozext-commits
mailing list