Mercurial > ambnews-firefox
diff ambnews/components/about.js @ 2:88b12596346d
Added an about:news handler and made the default page for new tabs about:news.
| author | Atul Varma <varmaa@toolness.com> |
|---|---|
| date | Thu, 21 Aug 2008 17:00:35 -0700 |
| parents | |
| children | f259d52d361e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ambnews/components/about.js Thu Aug 21 17:00:35 2008 -0700 @@ -0,0 +1,36 @@ +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +const Cc = Components.classes; +const Ci = Components.interfaces; + +function AmbNewsAboutHandler() { +} + +AmbNewsAboutHandler.prototype = { + newChannel : function(aURI) { + var ios = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService); + + var channel = ios.newChannel( + "chrome://ambnews/content/blank.html", + null, + null + ); + + channel.originalURI = aURI; + return channel; + }, + + getURIFlags: function(aURI) { + return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT; + }, + + classDescription: "Ambient News Page", + classID: Components.ID("0e6d5f40-6fdc-11dd-ad8b-0800200c9a66"), + contractID: "@mozilla.org/network/protocol/about;1?what=news", + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]) +}; + +function NSGetModule(aCompMgr, aFileSpec) { + return XPCOMUtils.generateModule([AmbNewsAboutHandler]); +}
