-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for proper mimetype in tags-that-block audit. #1432
Conversation
Technically wouldn't a script or stylesheet that 404s still block first paint until the failed request came back as 404? Probably not a big deal over h2, but maybe still worth reporting? Thanks for fixing! Funny that the DBW test scripts were never actually blocking |
Yea, true. Let me remove the 404 check. |
PTAL. Added a comment on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome thanks!
Should we still report on the 404 assets? Waiting for the 404 response could still take a while in a mobile environment. (plus it's not bad to warn about 404ed assets; OTOH maybe it's more appropriate for a separate 404 audit or something) |
We can (probably should for completeness), but what do you think the behavior should be? I was also thinking a separate 404/"wasted resources" audit would be useful. |
Is the initiator information still there? We could still link it up with the tags later on and shift the logic down there (for parser initiator) |
@@ -91,19 +91,25 @@ function collectTagsThatBlockFirstPaint() { | |||
|
|||
function filteredAndIndexedByUrl(networkRecords) { | |||
return networkRecords.reduce((prev, record) => { | |||
// Filter stylesheet, javascript, and html import mimetypes. | |||
const isHtml = record._mimeType.indexOf('html') > -1; | |||
console.log(record._initiator.type, record._mimeType, record._url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha yep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
PTAL |
LGTM |
* Filter out links/scripts that 404 from tags that block audit. Part of GoogleChrome#1431 * Remove 404 check and add comment * Include 404 scripts/links in blocking resources * remove console.log
* Filter out links/scripts that 404 from tags that block audit. Part of GoogleChrome#1431 * Remove 404 check and add comment * Include 404 scripts/links in blocking resources * remove console.log
R: @patrickhulce all
Resources that fail or are missing a mimetype are now filtered out of the blocking link/scripts gatherer. This also changes the dbw_tester to not wrap these resources in a
<template>
so their parser initiated and not script initiated.See #1431 for a full explanation.