From 1696784a4986186a12ad5c9406adab1a9141283e Mon Sep 17 00:00:00 2001 From: Andre Vasconcelos Date: Tue, 23 Mar 2021 17:53:32 +0900 Subject: [PATCH 1/2] Temp: Testing issues with enabling throttling --- src/utils/lighthouse.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/lighthouse.js b/src/utils/lighthouse.js index 423b314..0f797db 100644 --- a/src/utils/lighthouse.js +++ b/src/utils/lighthouse.js @@ -57,7 +57,8 @@ async function launchPuppeteer(url, options) { if (options.seo) opts.onlyCategories.push('seo'); // as throttling is enabled by default in lighthouse, disable it if explicitly unchecked - if (options.throttling === false) { + console.log(options.throttling) + if (options.throttling === false || options.throttling === 'false') { // Values referenced in // https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/constants.js opts.throttlingMethod = 'provided'; From 03fbb5a3ce485350316da6e91a4a126a9631a11d Mon Sep 17 00:00:00 2001 From: Andre Vasconcelos Date: Tue, 23 Mar 2021 18:14:04 +0900 Subject: [PATCH 2/2] Fixing incorrect default throttling option --- src/routes/index.js | 4 ++-- src/utils/lighthouse.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/index.js b/src/routes/index.js index 0a0873a..d755e9d 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -199,8 +199,8 @@ router.post('/receive_submission', async function(req, res) { const {channel, is_schedule} = JSON.parse(res_data.view.private_metadata); let submission = { - throttling: true, - performance: true, + throttling: false, + performance: false, seo: false, pwa: false, 'best-practices': false, diff --git a/src/utils/lighthouse.js b/src/utils/lighthouse.js index 0f797db..a4af532 100644 --- a/src/utils/lighthouse.js +++ b/src/utils/lighthouse.js @@ -57,8 +57,7 @@ async function launchPuppeteer(url, options) { if (options.seo) opts.onlyCategories.push('seo'); // as throttling is enabled by default in lighthouse, disable it if explicitly unchecked - console.log(options.throttling) - if (options.throttling === false || options.throttling === 'false') { + if (options.throttling === false) { // Values referenced in // https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/constants.js opts.throttlingMethod = 'provided'; @@ -71,6 +70,7 @@ async function launchPuppeteer(url, options) { downloadThroughputKbps: 0, uploadThroughputKbps: 0, }; + opts.formFactor = 'desktop' opts.screenEmulation = { mobile: false, width: 1350,