-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(chromium): pass auto attach filter for iframes #36784
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
Conversation
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"8 flaky46499 passed, 816 skipped Merge workflow run. |
filter: [ | ||
{ type: 'iframe' }, | ||
{ type: 'worker' }, | ||
{ type: 'service_worker', exclude: !process.env.PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS } |
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 we never want service workers under a page, we get them through setAutoAttach
on the browser target.
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.
The service worker tests fail without this setting, so apparently we rely on the short period when the sw target is enabled.
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.
If we don't auto-attach to sw in the page, there Network.requestWillBeSent
event is missing for the service worker main resource. Notably it is missing in the top level session, not in the page session.
{"method":"Network.requestWillBeSent","params":{"requestId":"B66BDCC8DEB22DC41E120AA63F9610D6","loaderId":"","documentURL":"http://localhost:8907/serviceworkers/fetch/sw.js","request":{"url":"http://localhost:8907/serviceworkers/fetch/sw.js","method":"GET","headers":{"Accept":"*/*","Service-Worker":"script"},"initialPriority":"VeryLow","referrerPolicy":"strict-origin-when-cross-origin"},"timestamp":787594.978643,"wallTime":1753466030.385725,"initiator":{"type":"other","url":"http://localhost:8907/serviceworkers/fetch/sw.html"},"redirectHasExtraInfo":false,"type":"Script","hasUserGesture":false},"sessionId":"45C9C821DA0B480516D191C866250105"}
flatten: true, | ||
filter: [ | ||
{ type: 'worker' }, | ||
{ type: 'service_worker', exclude: !process.env.PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS } |
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.
Same here, we only care about workers.
The filtering has been available in Chromium since https://source.chromium.org/chromium/chromium/src/+/c50f73d494d21482bf2cbefa430ce75fc2ad1963. Pass the filter to avoid having to send
Target.detachFromTarget
which is problematic if we connect to a page via debugger extension API which will throw on attempt to detach e.g. from a service worker.