Skip to content

Conversation

@mxschmitt
Copy link
Contributor

Fixes #18761

@mxschmitt mxschmitt marked this pull request as ready for review September 9, 2025 22:45
@github-actions

This comment has been minimized.

Console events are only supported on Chromium-based browsers and within Service Workers.
:::

Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.
Copy link
Member

Choose a reason for hiding this comment

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

What about browser warning/errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is copied from event: Page.console.


Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated.

## event: Worker.console
Copy link
Member

Choose a reason for hiding this comment

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

Should we dispatch it on the BrowserContext/Page instead and have a property indicating that it is from a service worker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets defer that to API review.

@github-actions

This comment has been minimized.

@mxschmitt mxschmitt merged commit 60bf27c into microsoft:main Sep 9, 2025
33 of 35 checks passed
@mxschmitt mxschmitt deleted the add-service-worker-console-events branch September 9, 2025 23:38
@github-actions
Copy link
Contributor

Test results for "tests 1"

3 failed
❌ [playwright-test] › playwright.trace.spec.ts:345 › should retain traces for interrupted tests @macos-latest-node18-1
❌ [playwright-test] › reporter-html.spec.ts:724 › merged › should warn user when viewing via file:// protocol @macos-latest-node18-2
❌ [playwright-test] › reporter-html.spec.ts:724 › created › should warn user when viewing via file:// protocol @macos-latest-node18-2

1 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`

46789 passed, 821 skipped


Merge workflow run.

mxschmitt added a commit to mxschmitt/playwright that referenced this pull request Sep 25, 2025
mxschmitt added a commit to mxschmitt/playwright that referenced this pull request Sep 25, 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.

[Feature] Intercept console of service worker

2 participants