annotate ambnews/components/about.js @ 5:8cafc4c42c29

Changed page annotations from AmbNews/something to ambnews/something to match the way other paths are done, but it appears that page annotations are case-insensitive anyways, which is cool I guess.
author Atul Varma <varmaa@toolness.com>
date Thu, 21 Aug 2008 17:46:17 -0700
parents 88b12596346d
children f259d52d361e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
1 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
2
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
3 const Cc = Components.classes;
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
4 const Ci = Components.interfaces;
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
5
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
6 function AmbNewsAboutHandler() {
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
7 }
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
8
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
9 AmbNewsAboutHandler.prototype = {
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
10 newChannel : function(aURI) {
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
11 var ios = Cc["@mozilla.org/network/io-service;1"].
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
12 getService(Ci.nsIIOService);
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
13
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
14 var channel = ios.newChannel(
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
15 "chrome://ambnews/content/blank.html",
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
16 null,
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
17 null
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
18 );
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
19
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
20 channel.originalURI = aURI;
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
21 return channel;
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
22 },
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
23
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
24 getURIFlags: function(aURI) {
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
25 return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT;
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
26 },
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
27
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
28 classDescription: "Ambient News Page",
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
29 classID: Components.ID("0e6d5f40-6fdc-11dd-ad8b-0800200c9a66"),
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
30 contractID: "@mozilla.org/network/protocol/about;1?what=news",
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
31 QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule])
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
32 };
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
33
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
34 function NSGetModule(aCompMgr, aFileSpec) {
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
35 return XPCOMUtils.generateModule([AmbNewsAboutHandler]);
88b12596346d Added an about:news handler and made the default page for new tabs about:news.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
36 }