Bug 179642 - ServiceWorker Inspector: Frontend changes to support Network tab and sub resources
Summary: ServiceWorker Inspector: Frontend changes to support Network tab and sub reso...
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: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-13 15:36 PST by Joseph Pecoraro
Modified: 2017-11-28 15:45 PST (History)
10 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (27.21 KB, patch)
2017-11-17 15:49 PST, Joseph Pecoraro
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
[IMAGE] Resources Tab (163.53 KB, image/png)
2017-11-17 15:50 PST, Joseph Pecoraro
no flags Details
[IMAGE] Network Tab - Table (98.38 KB, image/png)
2017-11-17 15:51 PST, Joseph Pecoraro
no flags Details
[IMAGE] Network Tab - Detail (130.08 KB, image/png)
2017-11-17 15:51 PST, Joseph Pecoraro
no flags Details
Archive of layout-test-results from ews100 for mac-elcapitan (2.56 MB, application/zip)
2017-11-17 16:43 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-elcapitan (3.52 MB, application/zip)
2017-11-17 17:24 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (3.79 MB, application/zip)
2017-11-17 17:43 PST, EWS Watchlist
no flags Details
[PATCH] Proposed Fix (30.71 KB, patch)
2017-11-27 16:49 PST, Joseph Pecoraro
bburg: review+
bburg: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-11-13 15:36:34 PST
ServiceWorker Inspector: Frontend changes to support Network tab and sub resources

Network Tab:
- Should show requests made by the ServiceWorker

Resource Tab: (UI like a Dedicated Worker)
- Should show sub-resources loaded by the ServiceWorker
- Should categorize the sub-resources underneath the ServiceWorker component
Comment 1 Radar WebKit Bug Importer 2017-11-13 15:36:53 PST
<rdar://problem/35517704>
Comment 2 Joseph Pecoraro 2017-11-17 15:49:37 PST
Created attachment 327258 [details]
[PATCH] Proposed Fix

There are a few things I want to address in follow-ups:

1. Image resources added via CacheStorage.prototype.add / fetch() don't show up properly
  - this is essentially pre-existing bad behavior for fetching any binary content

2. Metrics data is not included
  - this requires enabling ResourceTiming in ServiceWorkers, which I'll be looking into
Comment 3 Joseph Pecoraro 2017-11-17 15:50:40 PST
Created attachment 327259 [details]
[IMAGE] Resources Tab
Comment 4 Joseph Pecoraro 2017-11-17 15:51:03 PST
Created attachment 327260 [details]
[IMAGE] Network Tab - Table
Comment 5 Joseph Pecoraro 2017-11-17 15:51:23 PST
Created attachment 327261 [details]
[IMAGE] Network Tab - Detail
Comment 6 Joseph Pecoraro 2017-11-17 15:52:00 PST
Note that the ResponseSource is an emdash right now, that is related to the other metrics that will be enabled with ResourceTiming.
Comment 7 EWS Watchlist 2017-11-17 16:43:39 PST Comment hidden (obsolete)
Comment 8 EWS Watchlist 2017-11-17 16:43:40 PST Comment hidden (obsolete)
Comment 9 EWS Watchlist 2017-11-17 17:24:49 PST Comment hidden (obsolete)
Comment 10 EWS Watchlist 2017-11-17 17:24:50 PST Comment hidden (obsolete)
Comment 11 EWS Watchlist 2017-11-17 17:43:16 PST Comment hidden (obsolete)
Comment 12 EWS Watchlist 2017-11-17 17:43:18 PST Comment hidden (obsolete)
Comment 13 Joseph Pecoraro 2017-11-27 16:49:57 PST
Created attachment 327713 [details]
[PATCH] Proposed Fix

I was missing `WI.pageTarget` in Test.js
Comment 14 BJ Burg 2017-11-28 12:58:15 PST
Comment on attachment 327713 [details]
[PATCH] Proposed Fix

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

r=me

> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:522
> +            if (type === "Document" && frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier)

I'd prefer we move the enum somewhere else, rather than rely on bare string literals. Could it go on NetworkAgent? This can be a followup if it gets messy.

> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:524
> +            else if (type === "Document" && frame.provisionalMainResource && frame.provisionalMainResource.url === url && frame.provisionalLoaderIdentifier === loaderIdentifier)

Ditto.

> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:710
> +            if (resourcePayload.type === "Document" && resourcePayload.url === payload.frame.url)

Ditto.

> Source/WebInspectorUI/UserInterface/Models/Resource.js:98
> +    static preferredType(type, mimeType)

This name is somewhat vague.

> Source/WebInspectorUI/UserInterface/Protocol/Connection.js:275
> +InspectorBackend.MainConnection = class InspectorBackendMainConnection extends InspectorBackend.Connection

OK

> Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js:876
> +        let populateTargetResources = (target) => {

Nit: I would use Cocoa style naming, populateResourcesForFrame() populateResourcesForTarget()
Comment 15 Joseph Pecoraro 2017-11-28 15:37:09 PST
Comment on attachment 327713 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:522
>> +            if (type === "Document" && frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier)
> 
> I'd prefer we move the enum somewhere else, rather than rely on bare string literals. Could it go on NetworkAgent? This can be a followup if it gets messy.

Yeah, we will want to move this to Network eventually. At this point Network should be considered the base and Page / ServiceWorker are disjoint and both would have a Network component.

>> Source/WebInspectorUI/UserInterface/Models/Resource.js:98
>> +    static preferredType(type, mimeType)
> 
> This name is somewhat vague.

Hmm, would bestType() or mostSpecificType() be better? This is something I'm going to be circling back to as I try to make an XHR/Fetch of an Image resource show properly.

>> Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js:876
>> +        let populateTargetResources = (target) => {
> 
> Nit: I would use Cocoa style naming, populateResourcesForFrame() populateResourcesForTarget()

I like that suggestion.
Comment 16 Joseph Pecoraro 2017-11-28 15:45:54 PST
<https://trac.webkit.org/r225244>