INNER CODE UNIT · JavaScript
launch
tiliondev/fortress · sdk/node/index.js:124
static async launch(opts) { return new Fortress(opts).start(); }
async start() {
const plat = resolvePlatform();
const native = plat && (plat === "linux-x64" || await assetExists(plat, this.host));
if (native) await this._startNative(plat); else this._startDocker();
this.cdpUrl = await waitCdp(this.port);
return this;
}
async _startNative(plat) {
const launcher = await ensureNative(plat, this.host, this.tag);
const args = [];
if (this.headless) args.push("--headless=new", "--no-sandbox");
args.push(`--remote-debugging-port=${this.port}`, `--user-data-dir=${join(CACHE, "profile")}`,
...personaArgs(this.persona), ...this.extraArgs);
this.proc = spawn(launcher, args, { stdio: "ignore", shell: launcher.endsWith(".cmd") });
}