From c943dac22616ac85ccd1200bdd913a7b7e67148d Mon Sep 17 00:00:00 2001 From: younglim Date: Fri, 31 Mar 2023 17:32:17 +0800 Subject: [PATCH] Use customWidth as conditional launch scan with custom width --- crawlers/crawlDomain.js | 2 +- crawlers/crawlSitemap.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crawlers/crawlDomain.js b/crawlers/crawlDomain.js index 949c8fc3..65536bae 100644 --- a/crawlers/crawlDomain.js +++ b/crawlers/crawlDomain.js @@ -25,7 +25,7 @@ const crawlDomain = async (url, randomToken, host, viewportSettings, maxRequests device = devices['iPhone 11']; } else if (customDevice === 'Samsung Galaxy S9+') { device = devices['Galaxy S9+']; - } else if (customDevice === "Specify viewport") { + } else if (viewportWidth) { device = { viewport: { width: Number(viewportWidth), height: 720 }}; } else if (customDevice) { device = devices[customDevice.replace('_', / /g)]; diff --git a/crawlers/crawlSitemap.js b/crawlers/crawlSitemap.js index e144b2ac..6463aa07 100644 --- a/crawlers/crawlSitemap.js +++ b/crawlers/crawlSitemap.js @@ -37,7 +37,7 @@ const crawlSitemap = async ( device = devices['iPhone 11']; } else if (customDevice === 'Samsung Galaxy S9+') { device = devices['Galaxy S9+']; - } else if (customDevice === "Specify viewport") { + } else if (viewportWidth) { device = { viewport: { width: Number(viewportWidth), height: 720 }}; } else if (customDevice) { device = devices[customDevice.replace('_', / /g)];