-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore: publish browser list via DebugController #37027
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: publish browser list via DebugController #37027
Conversation
packages/protocol/src/protocol.yml
Outdated
| items: | ||
| type: object | ||
| properties: | ||
| guid: string |
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.
Let's call this id, because guid has a special meaning in the protocol.
| onPageOpen: () => this._emitSnapshot(false), | ||
| onPageOpen: page => { | ||
| this._emitSnapshot(false); | ||
| page.on(Page.Events.InternalFrameNavigatedToNewDocument, () => this._emitSnapshot(false)); |
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.
- We should only
emitSnapshotupon main frame navigation to avoid spamming. - We have to remove the listener from the page/pages at some point.
This comment has been minimized.
This comment has been minimized.
| page.mainFrame().on(Frame.Events.InternalNavigation, handleNavigation); | ||
| this._disposeListeners.push(() => page.mainFrame().off(Frame.Events.InternalNavigation, handleNavigation)); | ||
| }, | ||
| onPageClose: () => this._emitSnapshot(false), |
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 removing the listener here will stop retaining the page object and prevent a memory leak.
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.
done! it was hard to put it into here though because of scoping, so I put it into the the other one.
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.
scratch that - there's a difference between Close and Crash! I need to figure that out.
|
|
||
| private _trackHierarchyListener: InstrumentationListener | undefined; | ||
| private _reportState = false; | ||
| private _disposeListeners: (() => void)[] = []; |
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.
Look into eventsHelper and RegisteredListener - perhaps those will come handy.
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.
Yeah I thought about those, but shoehorning instrumentation.addListener would've been difficult.
This comment has been minimized.
This comment has been minimized.
833137f to
0a861aa
Compare
Test results for "tests 1"3 failed 44 flaky46601 passed, 805 skipped Merge workflow run. |
)" This reverts commit 58cab06.
Useful for the browser list UI in VS Code, see #36732.