Skip to content

Commit 35a66fe

Browse files
author
Drew McMillan
committed
more
1 parent cb0c0b7 commit 35a66fe

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

example.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"url": "https://www.example.com",
3-
"maxDepth": 1,
4-
"maxChromeInstances": 5,
5-
"limit": "/music/",
2+
"url": "https://www.bbc.co.uk/news",
3+
"maxDepth": 2,
4+
"maxChromeInstances": 10,
5+
"limit": "/news/",
66
"httpsOnly": true,
7-
"showHttpLinksDuring": false,
7+
"showHttpLinksDuring": true,
88
"showHttpLinksAfter": true,
9-
"userAgent": "light-mc-crawler Mixed Content Crawler"
9+
"chromeFlags": "--no-sandbox --user-data-dir --headless --disable-setuid-sandbox --disable-gpu",
10+
"userAgent": "light-mc-crawler - News Discovery - Mixed Content Crawler"
1011
}

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ function runLighthouse (url, config, callback) {
108108
'--output-path=stdout',
109109
'--disable-device-emulation',
110110
'--disable-cpu-throttling',
111+
'--enable-error-reporting',
111112
'--disable-storage-reset',
112113
'--disable-network-throttling',
113114
'--chrome-flags=' + chromeFlags + '--user-agent=' + userAgent,
@@ -137,7 +138,14 @@ function runLighthouse (url, config, callback) {
137138
if(output != ''){
138139
console.error(`Parsing JSON report output failed for ${url}: ${output}`);
139140
console.log(parseError);
140-
} else{
141+
} else if (output.includes('Something went wrong')) {
142+
143+
console.log('SOMETHING WENT WRONG');
144+
console.log(output);
145+
146+
147+
148+
}else{
141149
console.error(`Lighthouse report returned nothing for ${url}`);
142150
}
143151

0 commit comments

Comments
 (0)