Skip to content

Conversation

@Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Aug 14, 2025

Useful for the browser list UI in VS Code, see #36732.

@Skn0tt Skn0tt requested a review from dgozman August 14, 2025 07:25
@Skn0tt Skn0tt self-assigned this Aug 14, 2025
items:
type: object
properties:
guid: string
Copy link
Contributor

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • We should only emitSnapshot upon main frame navigation to avoid spamming.
  • We have to remove the listener from the page/pages at some point.

@Skn0tt Skn0tt requested a review from dgozman August 14, 2025 07:48
@github-actions

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),
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member Author

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)[] = [];
Copy link
Contributor

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.

Copy link
Member Author

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.

@github-actions

This comment has been minimized.

@Skn0tt Skn0tt force-pushed the debug-controller-report-browers branch from 833137f to 0a861aa Compare August 14, 2025 08:39
@github-actions
Copy link
Contributor

Test results for "tests 1"

3 failed
❌ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:​124:5 › mobile viewport › respect meta viewport tag @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:​157:5 › mobile viewport › mouse should work with mobile viewports and cross process navigations @webkit-ubuntu-22.04-node18
❌ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:​175:5 › mobile viewport › should scroll when emulating a mobile viewport @webkit-ubuntu-22.04-node18

44 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:​284:3 › should click `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:​1079:7 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-add-script-tag.spec.ts:​93:3 › should throw when added with content to the CSP page `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:​104:3 › should work with strict CSP policy `@firefox-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:​80:5 › should show console messages for test `@ubuntu-latest-node22-1`
⚠️ [webkit-library] › library/browsercontext-pages.spec.ts:​82:3 › should click the button with offset with page scale `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/browsercontext-pages.spec.ts:​105:3 › should return bounding box with page scale `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:​87:5 › mobile viewport › should support window.orientation emulation `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:​97:5 › mobile viewport › should fire orientationchange event `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/defaultbrowsercontext-2.spec.ts:​28:3 › should work in persistent context `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/emulation-focus.spec.ts:​104:3 › should not affect screenshots `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/screenshot.spec.ts:​44:14 › page screenshot › should work with a mobile viewport `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/screenshot.spec.ts:​66:14 › page screenshot › should work with a mobile viewport and fullPage `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/screenshot.spec.ts:​77:14 › page screenshot › should work with device scale factor `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/screenshot.spec.ts:​205:14 › element screenshot › element screenshot should work with a mobile viewport `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/video.spec.ts:​411:5 › screencast › should capture css transformation `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/video.spec.ts:​441:5 › screencast › should work for popups `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/elementhandle-bounding-box.spec.ts:​30:3 › should handle nested frames `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/elementhandle-screenshot.spec.ts:​231:5 › element screenshot › should wait for element to stop moving `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/elementhandle-screenshot.spec.ts:​259:5 › element screenshot › should prefer type over extension `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-click.spec.ts:​1053:3 › should click a button that is overlaid by a permission popup `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​139:5 › page screenshot › should clip rect `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​153:5 › page screenshot › should clip rect with fullPage `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​169:5 › page screenshot › should clip elements to the viewport `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​183:5 › page screenshot › should throw on clip outside the viewport `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​197:5 › page screenshot › should run in parallel `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​215:5 › page screenshot › should take fullPage screenshots `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​224:5 › page screenshot › should take fullPage screenshots and mask elements outside of it `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​260:5 › page screenshot › should render white background on jpeg file `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​283:5 › page screenshot › should work for canvas `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​327:5 › page screenshot › should work for webgl `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​338:5 › page screenshot › should work for translateZ `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​345:5 › page screenshot › should work while navigating `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​358:5 › page screenshot › should work with iframe in shadow `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​364:5 › page screenshot › path option should work `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​380:5 › page screenshot › path option should detect jpeg `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​425:5 › page screenshot › should work with Array deleted `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​433:5 › page screenshot › should take fullPage screenshots during navigation `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​451:7 › page screenshot › mask option › should work `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​459:7 › page screenshot › mask option › should work with locator `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​468:7 › page screenshot › mask option › should work with elementhandle `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​488:7 › page screenshot › mask option › should mask inside iframe `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​580:7 › page screenshot › mask option › should remove elements based on attr `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-screenshot.spec.ts:​868:5 › page screenshot animations › should wait for fonts to load `@webkit-ubuntu-22.04-node18`

46601 passed, 805 skipped


Merge workflow run.

@Skn0tt Skn0tt merged commit 58cab06 into microsoft:main Aug 15, 2025
30 of 32 checks passed
Skn0tt added a commit to Skn0tt/playwright that referenced this pull request Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants