Bug 212850 - Web Inspector: XHR request with same URL as main resource will hide the main resource request
Summary: Web Inspector: XHR request with same URL as main resource will hide the main ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-05 15:22 PDT by Devin Rousso
Modified: 2020-06-10 09:20 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.26 KB, patch)
2020-06-05 15:24 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (5.44 KB, patch)
2020-06-09 14:53 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2020-06-05 15:22:35 PDT
# STEPS TO REPRODUCE
1. inspect <https://webkit.org>
2. evaluate `var xhr = new XMLHttpRequest(); xhr.open('POST', location.href, true); xhr.send();` in the Console
 => icon of main resource in Sources Tab changes to match XHR, but no new resource is shown
3. repeat step 2
 => new resource appears, but main resource still shows incorrectly
Comment 1 Devin Rousso 2020-06-05 15:24:17 PDT
Created attachment 401208 [details]
Patch
Comment 2 Devin Rousso 2020-06-05 15:48:07 PDT
<rdar://problem/33072149>
Comment 3 Devin Rousso 2020-06-05 15:49:33 PDT
Comment on attachment 401208 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401208&action=review

> Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js:-975
> -            // This is a new request for an existing frame, which might be the main resource or a new resource.
> -            if (resourceOptions.type === "Document" && frame.mainResource.url === url && frame.loaderIdentifier === resourceOptions.loaderIdentifier)
> -                resource = frame.mainResource;

I personally think that this is possibly a scary change, but at the same time I do think that this code is somewhat nonsensical, and my own local testing from browsing around the web didn't see any impact AFAICT.
Comment 4 BJ Burg 2020-06-09 12:56:19 PDT
Comment on attachment 401208 [details]
Patch

Can a test be written for this behavior? It seems not specific to the UI.
Comment 5 Devin Rousso 2020-06-09 14:53:37 PDT
Created attachment 401477 [details]
Patch
Comment 6 BJ Burg 2020-06-10 09:13:30 PDT
Comment on attachment 401477 [details]
Patch

r=me, thank you
Comment 7 EWS 2020-06-10 09:20:52 PDT
Committed r262842: <https://trac.webkit.org/changeset/262842>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401477 [details].