Fix Srutinizer issues

main
Elbert Alias 6 years ago
parent 5b911327f5
commit cd0b1b6e60

@ -1,6 +1,24 @@
(() => {
try {
addEventListener('message', onMessage);
const detectJs = chain => {
const properties = chain.split('.');
let value = properties.length ? window : null;
for ( let i = 0; i < properties.length; i ++ ) {
let property = properties[i];
if ( value && value.hasOwnProperty(property) ) {
value = value[property];
} else {
value = null;
break;
}
}
return typeof value === 'string' || typeof value === 'number' ? value : !!value;
};
const onMessage = event => {
if ( event.data.id !== 'patterns' ) {
@ -36,25 +54,7 @@
postMessage({ id: 'js', js }, '*');
};
const detectJs = chain => {
const properties = chain.split('.');
let value = properties.length ? window : null;
for ( let i = 0; i < properties.length; i ++ ) {
let property = properties[i];
if ( value && value.hasOwnProperty(property) ) {
value = value[property];
} else {
value = null;
break;
}
}
return typeof value === 'string' || typeof value === 'number' ? value : !!value;
};
addEventListener('message', onMessage);
} catch(e) {
// Fail quietly
}

@ -91,7 +91,7 @@ function appsToDomTemplate(response) {
for ( let cat in categories ) {
const apps = [];
for ( appName in categories[cat].apps ) {
for ( let appName in categories[cat].apps ) {
let confidence = response.tabCache.detected[appName].confidenceTotal;
let version = response.tabCache.detected[appName].version;

@ -123,7 +123,7 @@ class Wappalyzer {
this.driver.displayApps(this.detected[url.canonical], { language }, context);
resolve();
return resolve();
});
});
}
@ -152,7 +152,7 @@ class Wappalyzer {
return reject();
}
resolve();
return resolve();
}, () => resolve());
});
};

Loading…
Cancel
Save