|
3 | 3 | const response_bodies = $WPT_BODIES; |
4 | 4 | const script_response_bodies = $WPT_BODIES.filter(body => body.type === 'Script'); |
5 | 5 |
|
6 | | -function fetchWithTimeout(url) { |
7 | | - var controller = new AbortController(); |
8 | | - setTimeout(() => {controller.abort()}, 5000); |
9 | | - return fetch(url, {signal: controller.signal}); |
10 | | -} |
11 | | - |
12 | 6 | function getRawHtmlDocument() { |
13 | 7 | let rawHtml; |
14 | 8 | if (response_bodies.length > 0) { |
@@ -362,7 +356,7 @@ async function getSpeculationRules() { |
362 | 356 | return {htmlRules: htmlRules, httpHeaderRules: httpRules}; |
363 | 357 | } |
364 | 358 |
|
365 | | -return Promise.all([getLcpElement(), getSpeculationRules()]).then(([lcp_elem_stats, speculationRules]) => { |
| 359 | +return Promise.all([getLcpElement()]).then(([lcp_elem_stats]) => { |
366 | 360 | const lcpUrl = lcp_elem_stats.url; |
367 | 361 | const rawDoc = getRawHtmlDocument(); |
368 | 362 | // Start out with true, only if LCP element is an external resource will we eval & potentially set to false. |
@@ -394,7 +388,7 @@ return Promise.all([getLcpElement(), getSpeculationRules()]).then(([lcp_elem_sta |
394 | 388 | lcp_preload: lcpPreload, |
395 | 389 | web_vitals_js: getWebVitalsJS(), |
396 | 390 | gaming_metrics: gamingMetrics, |
397 | | - speculation_rules: speculationRules, |
| 391 | + speculation_rules: getSpeculationRules(), |
398 | 392 | }; |
399 | 393 | }).catch(error => { |
400 | 394 | return {errorName: error.name, errorMessage: error.message}; |
|
0 commit comments