google-chrome-devtoolschrome-devtools-protocol

When is the requestId equal to the loaderId in the Chrome DevTools Protocol?


I have a bunch of captured network requests originating from Google Chrome. The requests were captured with the requestWillBeSent callback, which has the following parameters:

requestId: RequestId
Request identifier.

loaderId: LoaderId
Loader identifier. Empty string if the request is fetched from worker.

Now, for most of these requests, the requestId is formatted like 25799.49, and the loaderId like 8404BB9497057A198BC72AC5FFBF635B.

But some requests have requestIds that are equal to the loaderId.

I wonder why this is the case, and what this signifies. For instance, look at these request and loader IDs:

 ["25799.13", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.12", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.11", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.10", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.5", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.3", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.4", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25799.2", "07F0091D2CD34936025433DF76F5C4E1"],
 ["07F0091D2CD34936025433DF76F5C4E1", "07F0091D2CD34936025433DF76F5C4E1"],
 ["25654.40", "1798A5235B193303395CA1B011110B14"],
 ["25654.39", "1798A5235B193303395CA1B011110B14"],
 ["25654.38", "1798A5235B193303395CA1B011110B14"],
 ["25654.37", "1798A5235B193303395CA1B011110B14"],
 ["25654.36", "1798A5235B193303395CA1B011110B14"],
 ["25654.35", "1798A5235B193303395CA1B011110B14"],
 ["25654.34", "1798A5235B193303395CA1B011110B14"],

What does it mean when the two entries are equal?


Solution

  • I have not read the Chromium source code, it would probably help here, but what I have read is the playwright source code. You can see on this line that matching loader and request IDs is one of the conditions for the request to be a navigation request:

    const isNavigationRequest = requestWillBeSentEvent.requestId === requestWillBeSentEvent.loaderId && requestWillBeSentEvent.type === 'Document';
    

    I'm not sure what requestId and loaderId matching but type != 'Document' means, though.