BrowserServer
方法
¥Methods
close
Added in: v1.8正常关闭浏览器并确保进程终止。
¥Closes the browser gracefully and makes sure the process is terminated.
用法
¥Usage
await browserServer.close();
返回
¥Returns
kill
Added in: v1.8终止浏览器进程并等待该进程退出。
¥Kills the browser process and waits for the process to exit.
用法
¥Usage
await browserServer.kill();
返回
¥Returns
process
Added in: v1.8生成浏览器应用进程。
¥Spawned browser application process.
用法
¥Usage
browserServer.process();
返回
¥Returns
wsEndpoint
Added in: v1.8浏览器 websocket url。
¥Browser websocket url.
浏览器 websocket 端点可用作 browserType.connect() 的参数来建立与浏览器的连接。
¥Browser websocket endpoint which can be used as an argument to browserType.connect() to establish connection to the browser.
用法
¥Usage
browserServer.wsEndpoint();
返回
¥Returns
事件
¥Events
on('close')
Added in: v1.8当浏览器服务器关闭时触发。
¥Emitted when the browser server closes.
用法
¥Usage
browserServer.on('close', data => {});