Bug 211414 - performance.getEntriesByType('resource') does not include script 404 responses
Summary: performance.getEntriesByType('resource') does not include script 404 responses
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-04 17:19 PDT by Eli Grey (:sephr)
Modified: 2022-02-12 21:02 PST (History)
4 users (show)

See Also:


Attachments
HTML script element-initiated request with 404 response (comparing Firefox, Safari, Chrome, and Edge) (1.83 MB, image/png)
2020-05-04 17:19 PDT, Eli Grey (:sephr)
no flags Details
HTML img element-initiated request with 404 response (comparing Firefox, Safari, Chrome, and Edge) (1.89 MB, image/png)
2020-05-04 17:21 PDT, Eli Grey (:sephr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Grey (:sephr) 2020-05-04 17:19:48 PDT
Created attachment 398439 [details]
HTML script element-initiated request with 404 response (comparing Firefox, Safari, Chrome, and Edge)

This is equivalent to the following Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=883400

Steps to reproduce the problem:
1. Load a page that requests a script that responds with a status code of 404.
2. Open Console in Developer Tools
3. Enter "var urls = []; window.performance.getEntriesByType('resource').forEach(function(r){urls.push(r.name)});"
4. The URL returning the 404 will not be displayed in the list of URLs

What is the expected behavior?
The URL returning the 404 should be displayed in the list of URLs.

See the attached screenshots to see how Safari treats 404s from different request initiator types. Firefox is the only browser that implements this correctly.
Comment 1 Eli Grey (:sephr) 2020-05-04 17:21:55 PDT
Created attachment 398440 [details]
HTML img element-initiated request with 404 response (comparing Firefox, Safari, Chrome, and Edge)

This screenshot shows how Safari correctly includes 404 responses from <img> elements, but not <script> elements.
Comment 2 Radar WebKit Bug Importer 2020-05-06 15:02:06 PDT
<rdar://problem/62947219>
Comment 3 Eli Grey (:sephr) 2020-05-06 16:34:19 PDT
A Chrome engineer has submitted a patch for the corresponding Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=883400#c28

This may be useful for the WebKit fix.
Comment 4 Brent Fulgham 2022-02-12 21:02:39 PST
This is actually:
<rdar://44388482>