Bug 164427 - Web Inspector: WorkerTarget's mainResource should be a Resource not a Script
Summary: Web Inspector: WorkerTarget's mainResource should be a Resource not a Script
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: InRadar
Depends on: 164425
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-04 13:27 PDT by Joseph Pecoraro
Modified: 2016-12-13 15:37 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-11-04 13:27:17 PDT
Summary:
WorkerTarget's mainResource should be a Resource not a Script

This is the frontend portion once we address bug 164425.

Currently, all Worker resource loads are RawResourceRequests. Such resources do not always get saved. In the past that was fine because they are typically ephemeral (XHR,Fetch, etc). However Worker resources are more like <script src="..."> and we should expect Web Inspector to be informed of them. This impacts Web Inspector in a few different ways:

    - If Web Inspector is opened after a page has loaded
      - Worker Script Resources are not guaranteed to exist so the frontend may not know about them
      - Worker Script Resources may show up as a Script instead of a Resource
        - being Script and not Resource, don't get a Resource Details Sidebar
        - being Script and not Resource, the Network tab won't have Resource load data
    - Web Inspector has a workaround converting the type from XHR -> Script in some places

Notes:
- WorkerScriptLoader issues ThreadableLoader requests that it knows will be Scripts. It would be good to type such requests as Script early on.
Comment 1 Radar WebKit Bug Importer 2016-11-04 13:27:29 PDT
<rdar://problem/29117462>
Comment 2 Joseph Pecoraro 2016-11-04 13:36:34 PDT
I have workarounds for most of these issues that merely check if the WorkerTarget's mainResource (a Script) has an associated Resource. But it would be nice to eliminate all of these workarounds in the frontend.