Bug 190505 - Web Inspector: preserve showing the Request/Response when switching between network entries
Summary: Web Inspector: preserve showing the Request/Response when switching between n...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-11 19:02 PDT by Devin Rousso
Modified: 2019-05-29 12:00 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2018-10-11 19:02:30 PDT
* STEPS TO REPRODUCE:
1. Open WebInspector on any page
2. Go to the Network tab
3. Select a resource that has a request payload (e.g. JSON sent with the request)
4. Show the "Request" content under "Preview"
5. Fire another request on the page
6. Select the newly added resource (it must also have a request payload)
 => "Response" content shown for the second resource instead of "Request"

Example request:

    fetch("data.json?" + Math.random(), {
        method: "POST",
        // headers: {"Content-Type": "application/json"},
        body: `{"a":1,"b":2,"c":3,"d":4,"e":5,"f":6}`,
    });
Comment 1 Devin Rousso 2018-10-11 21:39:51 PDT
As it turns out, this does work (mostly) as you'd expect.  The "Request"/"Response"/"JSON" choice is preserved per URL, but it is not preserved across URLs, meaning adding `Math.random()` to the end of the URL will cause each request to be given a different setting.  If you run the example in comment 0, but without the `Math.random`, it should work as expected.  Selecting to a network entry with a different URL, however, will not.

There's actually a FIXME in `WI.ResourceClusterContentView` about this exact issue.