Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/watcher.js

Issue 8410038: Removed backwards compatibility code (Closed)
Patch Set: Forgot the metadata change Created Sept. 22, 2012, 2:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | metadata » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/watcher.js
===================================================================
--- a/chrome/content/watcher.js
+++ b/chrome/content/watcher.js
@@ -11,40 +11,27 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
function abprequire(module)
{
let result = {};
result.wrappedJSObject = result;
Services.obs.notifyObservers(result, "adblockplus-require", module);
- if ("exports" in result)
- return result.exports;
- else
- return Cu.import("chrome://adblockplus-modules/content/" + module[0].toUpperCase() + module.substr(1) + ".jsm", null);
+ return result.exports;
}
let {Policy} = abprequire("contentPolicy");
let {RequestNotifier} = abprequire("requestNotifier");
let {Filter} = abprequire("filterClasses");
let policyGlobal = Cu.getGlobalForObject(Policy);
let PolicyPrivate = null;
-if (policyGlobal == window)
-{
- // Work-around for bug 736316 - getGlobalForObject gave us our own window
- let {XPIProvider} = Cu.import("resource://gre/modules/XPIProvider.jsm", null);
- let addonID = "{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}"
- if (addonID in XPIProvider.bootstrapScopes)
- policyGlobal = XPIProvider.bootstrapScopes[addonID];
-}
-if ("PolicyPrivate" in policyGlobal) // ABP 2.0.x
- PolicyPrivate = policyGlobal.PolicyPrivate;
-else if ("PolicyImplementation" in policyGlobal) // ABP 2.1+ with scope separation
+if ("PolicyImplementation" in policyGlobal) // ABP 2.1+ with scope separation
PolicyPrivate = policyGlobal.PolicyImplementation;
else if ("require" in policyGlobal) // ABP 2.1+ without scope separation
PolicyPrivate = policyGlobal.require.scopes.contentPolicy.PolicyImplementation;
else
window.close();
Thomas Greiner 2012/09/26 13:55:04 Could also be written as: let PolicyPrivate = pol
Wladimir Palant 2012/09/27 14:39:29 But the way it is understanding the code is much e
let origShouldLoad = PolicyPrivate.shouldLoad;
let origProcessNode = Policy.processNode;
« no previous file with comments | « no previous file | metadata » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld