Playwright page.consoleMessages() and page.pageErrors() accept a filter option
Introduced 2026-04-01 · score 0.95
HOW TO USE IT
When a browser test retrieves console messages or page errors, pass `filter` in the options object to control which entries are returned.
await page.consoleMessages({ filter: 'since-navigation' });await page.pageErrors({ filter: 'since-navigation' });WHY THIS HELPS
When retrieving console messages or page errors in a browser test, filter the returned entries.
REQUIREMENTS AND LIMITATIONS
- Version: v1.59.0
- filter: Optional value: `all` or `since-navigation`. Controls which messages or errors are returned; the docs do not define the individual values' behavior.
- Prerequisite: The filter option was added in Playwright v1.59.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.59.0
- https://playwright.dev/docs/api/class-page#page-console-messages
- https://playwright.dev/docs/api/class-page#page-page-errors
Check the installed version and the source before using it. Entry JSON