GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.4k stars 9.38k forks source link

Add network request source (frame/target) information #14157

Open brendankenny opened 2 years ago

brendankenny commented 2 years ago

Splitting off of #14078 from some discussions that happened last week.

Rather than rely on the sessionId approach we've used to determine if requests are coming from an OOPIF (and have had to add some hacks to preserve as DevTools and puppeteer were added as protocol intermediaries), we should add an explicit network request property that marks where the request came from.

Possibilities discussed (modulo naming):

It would also be useful to split up main frame requests and requests from in-process iframes, because sometimes we only want to deal with one or the other. One idea was more or less crdp.TargetType | 'oopif' for the enum.

Other open question: how to populate this in the network records? We've always been able to construct the network records purely from the devtoolslog, but there's not necessarily enough information in there to recreate this source enum (especially in timespans when the initial load wasn't seen). Each request has a frameId, but we don't always have frames to match those up to.

connorjclark commented 1 year ago

seems related to #14212