diff options
author | Einar Egilsson | 2009-10-16 08:11:33 +0000 |
---|---|---|
committer | Einar Egilsson | 2009-10-16 08:11:33 +0000 |
commit | 372aa4eee4e9b0b0a930d83a378502e9cec2e786 (patch) | |
tree | 1ca3dc9a5aed593fab4f671a1e3c9a87d51c59e0 /chrome/content/code | |
parent | 6177295e1d9a9ebba5acc68df4800d8557b22cab (diff) |
Greatly simplified XPCOM plumbing
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@270 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/code')
-rw-r--r-- | chrome/content/code/redirector.prototype.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/chrome/content/code/redirector.prototype.js b/chrome/content/code/redirector.prototype.js index 979e9f7..d575e52 100644 --- a/chrome/content/code/redirector.prototype.js +++ b/chrome/content/code/redirector.prototype.js @@ -1,18 +1,11 @@ //// $Id$
-Cc = Components.classes;
-Ci = Components.interfaces;
-Cr = Components.results;
-nsIContentPolicy = Ci.nsIContentPolicy;
-
Redirector.prototype = {
prefs : null,
list : null,
strings : null,
cout : Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService),
-
-
init : function() {
this.prefs = new Prefs();
@@ -72,19 +65,19 @@ Redirector.prototype = { try {
if (!this.prefs.enabled) {
- return nsIContentPolicy.ACCEPT;
+ return Ci.nsIContentPolicy.ACCEPT;
}
- if (contentType != nsIContentPolicy.TYPE_DOCUMENT) {
- return nsIContentPolicy.ACCEPT;
+ if (contentType != Ci.nsIContentPolicy.TYPE_DOCUMENT) {
+ return Ci.nsIContentPolicy.ACCEPT;
}
if (contentLocation.scheme != "http" && contentLocation.scheme != "https") {
- return nsIContentPolicy.ACCEPT;
+ return Ci.nsIContentPolicy.ACCEPT;
}
if (!aContext || !aContext.loadURI) {
- return nsIContentPolicy.ACCEPT;
+ return Ci.nsIContentPolicy.ACCEPT;
}
this.debug("Checking " + contentLocation.spec);
@@ -100,18 +93,18 @@ Redirector.prototype = { redirectUrl = this.makeAbsoluteUrl(url, result.redirectTo);
this.debug('Redirecting ' + url + ' to ' + redirectUrl);
aContext.loadURI(redirectUrl, requestOrigin, null);
- return nsIContentPolicy.REJECT_REQUEST;
+ return Ci.nsIContentPolicy.REJECT_REQUEST;
}
}
} catch(e) {
this.debug(e);
}
- return nsIContentPolicy.ACCEPT;
+ return Ci.nsIContentPolicy.ACCEPT;
},
// nsIContentPolicy interface implementation
shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra) {
- return nsIContentPolicy.ACCEPT;
+ return Ci.nsIContentPolicy.ACCEPT;
},
//nsIChannelEventSink interface implementation
|