mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-19 22:57:59 +01:00
Add -pentadactyl-remote command-line flag and CommandOption.STRINGMAP type.
--HG-- extra : rebase_source : a306ad6e8c2d019b92a6ff58414eb3ff8ab149b9
This commit is contained in:
@@ -40,8 +40,26 @@ CommandLineHandler.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
|
||||
handle: function (commandLine) {
|
||||
try {
|
||||
var remote = commandLine.handleFlagWithParam(config.name + "-remote", false);
|
||||
}
|
||||
catch (e) {
|
||||
util.dump("option '-" + config.name + "-remote' requires an argument\n");
|
||||
}
|
||||
|
||||
try {
|
||||
if (remote) {
|
||||
commandLine.preventDefault = true;
|
||||
require(global, "services");
|
||||
let win = services.windowMediator.getMostRecentWindow("navigator:browser");
|
||||
if (win && win.dactyl)
|
||||
win.dactyl.execute(remote);
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
util.reportError(e)
|
||||
};
|
||||
|
||||
// TODO: handle remote launches differently?
|
||||
try {
|
||||
this.optionValue = commandLine.handleFlagWithParam(config.name, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user