Add animate.css

main
Elbert Alias 8 years ago
parent f2a28f6105
commit 46b2e6face

@ -34,6 +34,15 @@
"script": "1c-bitrix", "script": "1c-bitrix",
"website": "http://www.1c-bitrix.ru" "website": "http://www.1c-bitrix.ru"
}, },
"animate.css": {
"cats": [
"18"
],
"html": [
"<link [^>]+(?:/([\\d.]+)/)?animate\\.(?:min\\.)?css\\;version:\\1"
],
"website": "https://daneden.github.io/animate.css/"
},
"2z Project": { "2z Project": {
"cats": [ "cats": [
"1" "1"

@ -177,7 +177,7 @@ browser.webRequest.onCompleted.addListener(request => {
message.subject.headers = headersCache[url.canonical]; message.subject.headers = headersCache[url.canonical];
} }
wappalyzer.analyze(url.hostname, url.canonical, message.subject, { wappalyzer.analyze(url, message.subject, {
tab: sender.tab tab: sender.tab
}); });
@ -323,7 +323,7 @@ wappalyzer.driver.ping = (hostnameCache, adCache) => {
.then(tracking => { .then(tracking => {
if ( tracking ) { if ( tracking ) {
if ( Object.keys(hostnameCache).length ) { if ( Object.keys(hostnameCache).length ) {
post('http://ping.wappalyzer.com/v3/', hostnameCache); post('https://api.wappalyzer.com/ping/v1/', hostnameCache);
} }
if ( adCache.length ) { if ( adCache.length ) {

@ -38,18 +38,15 @@ class Wappalyzer {
this.driver.log(message, source || '', type || 'debug'); this.driver.log(message, source || '', type || 'debug');
} }
analyze(hostname, url, data, context) { analyze(url, data, context) {
var apps = {}; var apps = {};
// Remove hash from URL
data.url = url = url.split('#')[0];
if ( typeof data.html !== 'string' ) { if ( typeof data.html !== 'string' ) {
data.html = ''; data.html = '';
} }
if ( this.detected[url] === undefined ) { if ( this.detected[url.canonical] === undefined ) {
this.detected[url] = {}; this.detected[url.canonical] = {};
} }
// Additional information // Additional information
@ -58,13 +55,11 @@ class Wappalyzer {
const language = matches && matches.length ? matches[1] : null; const language = matches && matches.length ? matches[1] : null;
Object.keys(this.apps).forEach(appName => { Object.keys(this.apps).forEach(appName => {
apps[appName] = this.detected[url] && this.detected[url][appName] ? this.detected[url][appName] : new Application(appName, this.apps[appName]); apps[appName] = this.detected[url.canonical] && this.detected[url.canonical][appName] ? this.detected[url.canonical][appName] : new Application(appName, this.apps[appName]);
var app = apps[appName]; var app = apps[appName];
if ( url ) { this.analyzeUrl(app, url);
this.analyzeUrl(app, url);
}
if ( data.html ) { if ( data.html ) {
this.analyzeHtml(app, data.html); this.analyzeHtml(app, data.html);
@ -103,16 +98,16 @@ class Wappalyzer {
}); });
this.resolveExcludes(apps); this.resolveExcludes(apps);
this.resolveImplies(apps, url); this.resolveImplies(apps, url.canonical);
this.cacheDetectedApps(apps, url); this.cacheDetectedApps(apps, url.canonical);
this.trackDetectedApps(apps, url, hostname, language); this.trackDetectedApps(apps, url, language);
if ( Object.keys(apps).length ) { if ( Object.keys(apps).length ) {
this.log(Object.keys(apps).length + ' apps detected: ' + Object.keys(apps).join(', ') + ' on ' + url, 'core'); this.log(Object.keys(apps).length + ' apps detected: ' + Object.keys(apps).join(', ') + ' on ' + url.canonical, 'core');
} }
this.driver.displayApps(this.detected[url], { language }, context); this.driver.displayApps(this.detected[url.canonical], { language }, context);
} }
/** /**
@ -127,7 +122,7 @@ class Wappalyzer {
*/ */
robotsTxtAllows(url) { robotsTxtAllows(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var parsed = this.parseUrl(url); var parsed = this.parseUrl(url.canonical);
if ( parsed.protocol !== 'http:' && parsed.protocol !== 'https:' ) { if ( parsed.protocol !== 'http:' && parsed.protocol !== 'https:' ) {
reject(); reject();
@ -185,7 +180,7 @@ class Wappalyzer {
* *
*/ */
ping() { ping() {
if ( Object.keys(this.hostnameCache).length + this.adCache.length > 200 ) { if ( Object.keys(this.hostnameCache).length + this.adCache.length > 50 ) {
this.driver.ping(this.hostnameCache, this.adCache); this.driver.ping(this.hostnameCache, this.adCache);
this.hostnameCache = {}; this.hostnameCache = {};
@ -349,38 +344,36 @@ class Wappalyzer {
/** /**
* Track detected applications * Track detected applications
*/ */
trackDetectedApps(apps, url, hostname, language) { trackDetectedApps(apps, url, language) {
if ( !( this.driver.ping instanceof Function ) ) { if ( !( this.driver.ping instanceof Function ) ) {
return; return;
} }
Object.keys(apps).forEach(appName => { const hostname = url.protocol + '//' + url.hostname;
var app = apps[appName];
if ( this.detected[url][appName].getConfidence() >= 100 ) { Object.keys(apps).forEach(appName => {
if ( validation.hostname.test(hostname) && !validation.hostnameBlacklist.test(url) ) { const app = apps[appName];
this.robotsTxtAllows(url)
.then(() => { if ( this.detected[url.canonical][appName].getConfidence() >= 100 ) {
if ( !( hostname in this.hostnameCache ) ) { if ( validation.hostname.test(url.hostname) && !validation.hostnameBlacklist.test(url.hostname) ) {
this.hostnameCache[hostname] = { if ( !( hostname in this.hostnameCache ) ) {
applications: {}, this.hostnameCache[hostname] = {
meta: {} applications: {},
}; meta: {}
} };
}
if ( !( appName in this.hostnameCache[hostname].applications ) ) { if ( !( appName in this.hostnameCache[hostname].applications ) ) {
this.hostnameCache[hostname].applications[appName] = { this.hostnameCache[hostname].applications[appName] = {
hits: 0 hits: 0
}; };
} }
this.hostnameCache[hostname].applications[appName].hits ++; this.hostnameCache[hostname].applications[appName].hits ++;
if ( apps[appName].version ) { if ( apps[appName].version ) {
this.hostnameCache[hostname].applications[appName].version = app.version; this.hostnameCache[hostname].applications[appName].version = app.version;
} }
})
.catch(() => this.log('Disallowed in robots.txt: ' + url), 'core')
} }
} }
}); });
@ -400,8 +393,8 @@ class Wappalyzer {
if ( patterns.length ) { if ( patterns.length ) {
patterns.forEach(pattern => { patterns.forEach(pattern => {
if ( pattern.regex.test(url) ) { if ( pattern.regex.test(url.canonical) ) {
this.addDetected(app, pattern, 'url', url); this.addDetected(app, pattern, 'url', url.canonical);
} }
}); });
} }