Modules (180)

LauncherDomain

Description

Dependencies

Variables

Private

_domainManager

Type
?DomainManager
Private
var _domainManager;

Functions

Private

_cmdLaunch

Launch the given URL in the system default browser. TODO: it now launching just on default browser, add launchers for specific browsers.

url string
function _cmdLaunch(url) {
    open(url);
}
Public API

init

Initializes the domain and registers commands.

domainManager DomainManager
The DomainManager for the server
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;