Skip to content

feat(api): add filter option to Page.consoleMessages()#39608

Merged
yury-s merged 6 commits intomicrosoft:mainfrom
yury-s:feat-console-messages-filter
Mar 11, 2026
Merged

feat(api): add filter option to Page.consoleMessages()#39608
yury-s merged 6 commits intomicrosoft:mainfrom
yury-s:feat-console-messages-filter

Conversation

@yury-s
Copy link
Member

@yury-s yury-s commented Mar 11, 2026

Adds a filter option ('all' | 'sinceNavigation') to Page.consoleMessages(). When 'sinceNavigation' is passed, only messages logged after the last committed main-frame navigation are returned. The last pre-navigation message is marked with a symbol in the shared array — no separate array needed.

yury-s added 2 commits March 10, 2026 18:11
Adds a `filter` option ('all' | 'sinceNavigation') to
`Page.consoleMessages()`. When 'sinceNavigation' is passed, only
messages logged after the last committed main-frame navigation are
returned. The last pre-navigation message is marked with a symbol
in the shared array — no separate array needed.
@pavelfeldman
Copy link
Member

MCP / cli param for all, default to since nav?

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- `filter` <[ConsoleMessagesFilter]<"all"|"sinceNavigation">>

Controls which messages are returned:
- `'sinceNavigation'` (default) — returns only messages logged after the last committed main-frame navigation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is't this a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@yury-s yury-s merged commit 24edbf7 into microsoft:main Mar 11, 2026
34 of 36 checks passed
@yury-s yury-s deleted the feat-console-messages-filter branch March 11, 2026 17:13
@github-actions
Copy link
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/http.spec.ts:207 › http transport browser lifecycle (persistent) @mcp-macos-latest

5243 passed, 164 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › playwright.trace.spec.ts:838 › should record nested steps, even after timeout @windows-latest-node20

2 flaky ⚠️ [chromium-library] › library/popup.spec.ts:260 › should not throw when click closes popup `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`

38935 passed, 848 skipped


Merge workflow run.

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.

3 participants