-
Notifications
You must be signed in to change notification settings - Fork 4.9k
chore: browser._launchServer #37031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: browser._launchServer #37031
Conversation
| }, | ||
|
|
||
| onConnection: (request, url, ws, id) => { | ||
| if (url.searchParams.has('debug-controller')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want this available on every server, so let's make it configurable.
| import { connectOverWebSocket } from './webSocket'; | ||
| import { TimeoutSettings } from './timeoutSettings'; | ||
|
|
||
| import type { Browser as BrowserImpl } from '../server/browser'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything goes wrong with the bots because we should not import server code from the client side. I'd recommend making launchServerOnExistingBrowser taking a client-side Browser instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried that in 820fd7f, but typescript still doesn't like it. how curious 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, the real problem was that I imported from src instead of lib in a test.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| host?: string, | ||
| port?: number, | ||
| wsPath?: string, | ||
| debugController?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep it private please.
| debugController?: boolean; | |
| _debugController?: boolean; |
| try { | ||
| const connection = this._delegate.onConnection(request, url, ws, id); | ||
| (ws as any)[kConnectionSymbol] = connection; | ||
| } catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely! I was about to comment that we should handle exceptions 😄
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"2 failed 21 flaky46594 passed, 803 skipped Merge workflow run. |
This reverts commit 3fdbc06.
Adds a private method for launching a playwright server for an existing browser, for usage from inside MCP.