-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(scripts): narrow to only listen to parsed events #14120
Conversation
My plan for enabling further instrumentation of workers scripts, OOPIF scripts, etc (anything not from main session) was to simply remove the |
I forgot to mention in the initial comment, |
Oh, then how does the legacy smoke test for oopif-scripts pass right now?
If legacy defaultSession has the flattened protocol, I'd expect the gatherer to get Scripts for Ah, because we need to send
Sounds good. |
On this topic… @connorjclark I was pitching brendan on changing the We have actually changed code to maintain these questionable conditionals.. but there's really no justification, from a CDP level, that the presence of a sessionId == not the "root" session. |
Right, it's not the same. See the deleted comment in this PR. Would we need to cross-validate it with target information, to know they are from 1) not the main frame session (this also will continue to use the mainSessionId hack for devtools) and 2) are from an iframe (today we fail this part)? the sessionId check was (apparently) a simple close-enough solution which lost us scripts from workers, and I'm not sure we ever realized that :) But also, if we are gonna start considering OOPIFs and don't want to make any distinction I don't think the change is worth the effort. Though I suppose we could want OOPIFs filtered in some audits but not others. |
The gatherer only wants network requests from the main session, and it ends up narrowing down to only handling
Debugger.scriptParsed
events. Rather than listening to the firehose of all events and narrowing to both requirements, it can instead listen just forDebugger.scriptParsed
directly on the main session.As the only other consumer of
session.addProtocolMessageListener()
besidesnetwork-monitor
, removing this also makes the refactors for #14078 a bit simpler.