aboutsummaryrefslogtreecommitdiff
path: root/chrome/code/component.js
diff options
context:
space:
mode:
authorEinar Egilsson2011-08-26 14:37:27 +0200
committerEinar Egilsson2011-08-26 14:37:27 +0200
commit3ac1838cba725705a96a9d7b65721b15f4ec67b1 (patch)
tree6eea260d1e5882ba1031c5bb78bd2b9ac0884fb9 /chrome/code/component.js
parent5aefd85d7975c8934b32a30a1dec68aa421cdee3 (diff)
Moved everything to a js module, removed custom xpcom interfaces
Diffstat (limited to 'chrome/code/component.js')
-rw-r--r--chrome/code/component.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/code/component.js b/chrome/code/component.js
new file mode 100644
index 0000000..453d134
--- /dev/null
+++ b/chrome/code/component.js
@@ -0,0 +1,21 @@
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+Ci = Components.interfaces;
+Cr = Components.results;
+
+Components.utils.import("chrome://redirector/content/code/redirector.js");
+
+function RedirectorComponent() { }
+
+RedirectorComponent.prototype = {
+ classDescription: "My Hello World Javascript XPCOM Component",
+ classID: Components.ID("{b7a7a54f-0581-47ff-b086-d6920cb7a3f7}"),
+ contractID: "@einaregilsson.com/redirector;1",
+ QueryInterface: function(iid) {
+ if (iid.equals(Ci.nsISupports) || iid.equals(Ci.nsIContentPolicy) || iid.equals(Ci.nsIChannelEventSink)) {
+ return Redirector;
+ }
+ throw Cr.NS_ERROR_NO_INTERFACE;
+ }
+};
+
+const NSGetFactory = XPCOMUtils.generateNSGetFactory([RedirectorComponent]);