File: commandline.js

package info (click to toggle)
conkeror 0.9.2%2Bgit100804-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,680 kB
  • ctags: 1,182
  • sloc: sh: 547; ansic: 272; xml: 107; makefile: 79
file content (37 lines) | stat: -rw-r--r-- 1,176 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
/**
 * (C) Copyright 2007 John J. Foerch
 * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
 *
 * Use, modification, and distribution are subject to the terms specified in the
 * COPYING file.
**/

const Cc = Components.classes;
const Ci = Components.interfaces;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");

function cmdline () {}
cmdline.prototype = {
    constructor: cmdline,
    handle: function (cmdline) {
        if (cmdline.preventDefault)
            return;
        cmdline.preventDefault = true;
        var conkeror = Cc["@conkeror.mozdev.org/application;1"]
            .getService()
            .wrappedJSObject;
        conkeror.handle_command_line(cmdline);
    },
    QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
    contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=conkeror",
    classID: Components.ID("{0f4dd758-b55a-4386-a79c-8698642eac51}"),
    classDescription: "clh_conkeror",
    _xpcom_categories: [{
            category: "command-line-handler",
            entry: "y-conkeror"
        }]
};

function NSGetModule (compMgr, fileSpec) {
    return XPCOMUtils.generateModule([cmdline]);
}