BrowserServer
方法 (Methods)
close
Added before v1.9Closes the browser gracefully and makes sure the process is terminated.
使用方式
await browserServer.close();
傳回值
kill
Added before v1.9Kills the browser process and waits for the process to exit.
使用方式
await browserServer.kill();
傳回值
process
Added before v1.9Spawned browser application process.
使用方式
browserServer.process();
傳回值
wsEndpoint
Added before v1.9Browser websocket url.
Browser websocket endpoint which can be used as an argument to browserType.connect() to establish connection to the browser.
Note that if the listen host
option in launchServer
options is not specified, localhost will be output anyway, even if the actual listening address is an unspecified address.
使用方式
browserServer.wsEndpoint();
傳回值
事件 (Events)
on('close')
Added before v1.9Emitted when the browser server closes.
使用方式
browserServer.on('close', data => {});