File: about-handler.js

package info (click to toggle)
vimperator 2.3.1-0%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,700 kB
  • ctags: 68
  • sloc: xml: 7,109; makefile: 32
file content (41 lines) | stat: -rw-r--r-- 1,284 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2009 by Doug Kearns
//
// This work is licensed for reuse under an MIT license. Details are
// given in the License.txt file included with this file.

const Name = "Vimperator";
/*
 * We can't load our modules here, so the following code is sadly
 * duplicated: .w !sh
vimdiff ../../*'/components/about-handler.js'
 */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");

const Cc = Components.classes;
const Ci = Components.interfaces;

const name = Name.toLowerCase();
function AboutHandler() {}
AboutHandler.prototype = {

    classDescription: "About " + Name + " Page",

    classID: Components.ID("81495d80-89ee-4c36-a88d-ea7c4e5ac63f"),

    contractID: "@mozilla.org/network/protocol/about;1?what=" + name,

    QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),

    newChannel: function (uri) {
        let channel = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
                          .newChannel("chrome://" + name + "/content/about.html", null, null);
        channel.originalURI = uri;
        return channel;
    },

    getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT
};

function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler])

// vim: set fdm=marker sw=4 ts=4 et: