lighthouse-security-audit
Version:
Security measures using lighthouse
13 lines (10 loc) • 370 B
JavaScript
;
const Gatherer = require('lighthouse').Gatherer;
class CspMetaGatherer extends Gatherer {
afterPass(options) {
const driver = options.driver;
const metaSelector = 'meta[http-equiv="Content-Security-Policy"]';
return driver.evaluateAsync(`window.document.querySelectorAll('${metaSelector}').length`);
}
}
module.exports = CspMetaGatherer;