Skip to content

Commit

Permalink
Merge branch 'main' into prioritize-lcp-rename
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Feb 7, 2023
2 parents 9bcac6f + 74ead2a commit 873b49f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cli/test/smokehouse/test-definitions/metrics-tricky-tti.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const expectations = {
finalDisplayedUrl: 'http://localhost:10200/tricky-tti.html',
audits: {
'interactive': {
// https://bugs.chromium.org/p/chromium/issues/detail?id=1413830
_maxChromiumVersion: '111',
// stalls for ~5 seconds, ~5 seconds out, so should be at least ~10s
numericValue: '>9900',
},
Expand Down
10 changes: 7 additions & 3 deletions core/audits/valid-source-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import {Audit} from './audit.js';
import {EntityClassification} from '../computed/entity-classification.js';
import * as i18n from '../lib/i18n/i18n.js';
import {Util} from '../../shared/util.js';
import UrlUtils from '../lib/url-utils.js';

const UIStrings = {
/** Title of a Lighthouse audit that provides detail on HTTP to HTTPS redirects. This descriptive title is shown to users when HTTP traffic is redirected to HTTPS. */
Expand Down Expand Up @@ -54,11 +56,13 @@ class ValidSourceMaps extends Audit {
* @return {boolean}
*/
static isLargeFirstPartyJS(script, classifiedEntities) {
if (!script.length) return false;
const url = script.url;
if (!script.length || !url) return false;
if (!UrlUtils.isValid(url)) return false;
if (!Util.createOrReturnURL(url).protocol.startsWith('http')) return false;

const isLargeJS = script.length >= LARGE_JS_BYTE_THRESHOLD;
const isFirstPartyJS = script.url ? classifiedEntities.isFirstParty(script.url) : false;
return isLargeJS && isFirstPartyJS;
return classifiedEntities.isFirstParty(url) && isLargeJS;
}

/**
Expand Down

0 comments on commit 873b49f

Please sign in to comment.