Fix linting issues

main
Elbert Alias 7 years ago
parent acd2fcb3f2
commit cbca9c3e7a

@ -174,7 +174,7 @@
video_assets: opt_video_assets, video_assets: opt_video_assets,
assets: opt_assets, assets: opt_assets,
version: '3', version: '3',
mrev: '4aeaa5a-c', mrev: 'fe20291-c',
msgNum: this.msgNum, msgNum: this.msgNum,
timestamp: new Date().getTime(), timestamp: new Date().getTime(),
pageVis: document.visibilityState, pageVis: document.visibilityState,
@ -859,7 +859,7 @@
let _pageTags; let _pageTags;
const INIT_MS_BW_SEARCHES = 2000; const INIT_MS_BW_SEARCHES = 2000;
const PAGE_TAG_RE = new RegExp('gpt|oascentral'); const PAGE_TAG_RE = new RegExp('gpt|oascentral');
const POST_MSG_ID = '1519242200-10756-12873-1462-13403'; const POST_MSG_ID = '1532387537-31575-24732-11173-32339';
const AD_SERVER_RE = new RegExp('^(google_ads_iframe|oas_frame|atwAdFrame)'); const AD_SERVER_RE = new RegExp('^(google_ads_iframe|oas_frame|atwAdFrame)');
function getPageTags(doc) { function getPageTags(doc) {

File diff suppressed because it is too large Load Diff

@ -291,12 +291,12 @@ class Wappalyzer {
let userAgent; let userAgent;
robotsTxt.split('\n').forEach((line) => { robotsTxt.split('\n').forEach((line) => {
let matches = /^User-agent:\s*(.+)$/i.exec(line); let matches = /^User-agent:\s*(.+)$/i.exec(line.trim());
if (matches) { if (matches) {
userAgent = matches[1].toLowerCase(); userAgent = matches[1].toLowerCase();
} else if (userAgent === '*' || userAgent === 'wappalyzer') { } else if (userAgent === '*' || userAgent === 'wappalyzer') {
matches = /^Disallow:\s*(.+)$/i.exec(line); matches = /^Disallow:\s*(.+)$/i.exec(line.trim());
if (matches) { if (matches) {
disallow.push(matches[1]); disallow.push(matches[1]);
@ -394,39 +394,41 @@ class Wappalyzer {
resolveImplies(apps, url) { resolveImplies(apps, url) {
let checkImplies = true; let checkImplies = true;
// Implied applications const resolve = (appName) => {
// Run several passes as implied apps may imply other apps const app = apps[appName];
while (checkImplies) {
checkImplies = false;
Object.keys(apps).forEach((appName) => {
const app = apps[appName];
if (app && app.props.implies) { if (app && app.props.implies) {
asArray(app.props.implies).forEach((implied) => { asArray(app.props.implies).forEach((implied) => {
[implied] = this.parsePatterns(implied); [implied] = this.parsePatterns(implied);
if (!this.apps[implied.string]) { if (!this.apps[implied.string]) {
this.log(`Implied application ${implied.string} does not exist`, 'core', 'warn'); this.log(`Implied application ${implied.string} does not exist`, 'core', 'warn');
return; return;
} }
if (!(implied.string in apps)) { if (!(implied.string in apps)) {
apps[implied.string] = this.detected[url] && this.detected[url][implied.string] apps[implied.string] = this.detected[url] && this.detected[url][implied.string]
? this.detected[url][implied.string] ? this.detected[url][implied.string]
: new Application(implied.string, this.apps[implied.string], true); : new Application(implied.string, this.apps[implied.string], true);
checkImplies = true; checkImplies = true;
} }
// Apply app confidence to implied app // Apply app confidence to implied app
Object.keys(app.confidence).forEach((id) => { Object.keys(app.confidence).forEach((id) => {
apps[implied.string].confidence[`${id} implied by ${appName}`] = app.confidence[id] * (implied.confidence === undefined ? 1 : implied.confidence / 100); apps[implied.string].confidence[`${id} implied by ${appName}`] = app.confidence[id] * (implied.confidence === undefined ? 1 : implied.confidence / 100);
});
}); });
} });
}); }
};
// Implied applications
// Run several passes as implied apps may imply other apps
while (checkImplies) {
checkImplies = false;
Object.keys(apps).forEach(resolve);
} }
} }