Launch the given URL in the system default browser. TODO: it now launching just on default browser, add launchers for specific browsers.
function _cmdLaunch(url) {
open(url);
}
Initializes the domain and registers commands.
function init(domainManager) {
_domainManager = domainManager;
if (!domainManager.hasDomain("launcher")) {
domainManager.registerDomain("launcher", {major: 0, minor: 1});
}
domainManager.registerCommand(
"launcher", // domain name
"launch", // command name
_cmdLaunch, // command handler function
false, // this command is synchronous in Node
"Launches a given HTML file in the browser for live development",
[
{ name: "url", type: "string", description: "file:// url to the HTML file" },
{ name: "browser", type: "string", description: "browser name"}
],
[]
);
}
exports.init = init;