Skip to content

Commit c98e647

Browse files
authored
Merge pull request #23 from Webperf-se/no-content
Added logic for when page was unreachable
2 parents bb8b0f9 + 110ea05 commit c98e647

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

lib/harAnalyzer.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,32 @@ export class HarAnalyzer {
100100
return knowledgeData;
101101
}
102102

103+
if (!('htmls' in analyzedData)) {
104+
return knowledgeData;
105+
}
106+
107+
if (analyzedData['htmls'].length === 0) {
108+
knowledgeData['issues'] = {
109+
'no-network': {
110+
'rule': 'no-network',
111+
'category': 'technical',
112+
'severity': 'warning',
113+
'subIssues': [
114+
{
115+
'url': url,
116+
'rule': 'no-network',
117+
'category': 'standard',
118+
'severity': 'warning',
119+
'text': `No HTML content found in the HAR file.`,
120+
'line': 0,
121+
'column': 0
122+
}
123+
]
124+
}
125+
};
126+
return knowledgeData;
127+
}
128+
103129
if (!('all-scripts' in analyzedData)) {
104130
return knowledgeData;
105131
}

0 commit comments

Comments
 (0)