CREDITS: update
[conkeror.git] / components / command-line.js
blob308821e84bce4a537b4e3d79567003b686df390c
1 /**
2  * (C) Copyright 2007 John J. Foerch
3  * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
4  *
5  * Use, modification, and distribution are subject to the terms specified in the
6  * COPYING file.
7 **/
9 const Cc = Components.classes;
10 const Ci = Components.interfaces;
11 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
13 function cmdline () {}
14 cmdline.prototype = {
15     constructor: cmdline,
16     handle: function (cmdline) {
17         if (cmdline.preventDefault)
18             return;
19         cmdline.preventDefault = true;
20         var conkeror = Cc["@conkeror.mozdev.org/application;1"]
21             .getService()
22             .wrappedJSObject;
23         conkeror.handle_command_line(cmdline);
24     },
25     QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
26     contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=conkeror",
27     classID: Components.ID("{0f4dd758-b55a-4386-a79c-8698642eac51}"),
28     classDescription: "clh_conkeror",
29     _xpcom_categories: [{
30             category: "command-line-handler",
31             entry: "y-conkeror"
32         }]
35 if (XPCOMUtils.generateNSGetFactory)
36     var NSGetFactory = XPCOMUtils.generateNSGetFactory([cmdline]); //XULRunner 2.0
37 else
38     var NSGetModule = XPCOMUtils.generateNSGetModule([cmdline]);