session.connectToMainThread()


将会话连接到主线程检查器后端。如果这个 API 没有在 Worker 线程上调用,或者使用了 --process-timeout,将会抛出异常,因为会话可能会暂停主线程。

🌐 Connects a session to the main thread inspector back-end. An exception will be thrown if this API was not called on a Worker thread, or if --process-timeout is used, as the session could pause the main thread.