OLD | NEW |
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 /** | 9 /** |
10 * @module commandLine | 10 * @module commandLine |
11 */ | 11 */ |
12 | 12 |
13 Cu.import("resource://gre/modules/Services.jsm"); | 13 const {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {}); |
14 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); | |
15 | 14 |
16 let CommandLineHandler = | 15 let CommandLineHandler = |
17 { | 16 { |
18 // Starting the entry with "k" makes it have slightly higher priority than def
ault command line handlers. | 17 // Starting the entry with "k" makes it have slightly higher priority than def
ault command line handlers. |
19 classDescription: "k-abpcrawler", | 18 classDescription: "k-abpcrawler", |
20 contractID: "@adblockplus.org/abpcrawler/cmdline;1", | 19 contractID: "@adblockplus.org/abpcrawler/cmdline;1", |
21 classID: Components.ID("{973636c2-e842-11e4-b02c-1681e6b88ec1}"), | 20 classID: Components.ID("{973636c2-e842-11e4-b02c-1681e6b88ec1}"), |
22 xpcom_categories: ["command-line-handler"], | 21 xpcom_categories: ["command-line-handler"], |
23 | 22 |
24 init: function() | 23 init: function() |
(...skipping 27 matching lines...) Expand all Loading... |
52 { | 51 { |
53 let port = cmdline.handleFlagWithParam("crawler-port", false); | 52 let port = cmdline.handleFlagWithParam("crawler-port", false); |
54 if (port != null) | 53 if (port != null) |
55 require("main").startup(parseInt(port)); | 54 require("main").startup(parseInt(port)); |
56 }, | 55 }, |
57 | 56 |
58 QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler, Ci.nsIFactory
]) | 57 QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler, Ci.nsIFactory
]) |
59 }; | 58 }; |
60 | 59 |
61 CommandLineHandler.init(); | 60 CommandLineHandler.init(); |
OLD | NEW |