Merge pull request #1512 from wardoost/default-icon

Default icon
main
Elbert Alias 8 years ago committed by GitHub
commit 0f99dda1df

@ -12,43 +12,43 @@ var
for (app in json.apps) {
(function(app) {
var basePath = process.env.WAPPALYZER_ROOT + '/src/icons/';
var iconPath = json.apps[app].icon;
var path = basePath + iconPath;
var iconPath = json.apps[app].icon || 'default.svg';
var path = basePath + iconPath;
var type;
if (path.substr(path.length - 4) === '.png') {
type = "PNG";
}
else if (path.substr(path.length - 4) === '.svg') {
type = "SVG";
}
else {
var err = new Error('Icon file extension specified for app "' + app + '" is not ".png" or ".svg": src/icons/' + iconPath);
throw err;
}
var type;
if (path.substr(path.length - 4) === '.png') {
type = "PNG";
}
else if (path.substr(path.length - 4) === '.svg') {
type = "SVG";
}
else {
var err = new Error('Icon file extension specified for app "' + app + '" is not ".png" or ".svg": src/icons/' + iconPath);
throw err;
}
fs.exists(path, function(exists) {
if (exists) {
if (type === "PNG") {
var buffer = fileType(readChunk.sync(path, 0, 262));
if (buffer === null) {
var err = new Error('Unknown mimetype or bad file for "' + app + '": src/icons/' + iconPath);
throw err;
}
else if (buffer.mime !== 'image/png') {
var err = new Error('Incorrect mimetype "' + buffer.mime + '" when expected PNG for app "' + app + '": src/icons/' + iconPath);
throw err;
}
}
else if (type === "SVG") {
if (!isSvg(fs.readFileSync(path))) {
var err = new Error('Incorrect mimetype when expected SVG for app "' + app + '": src/icons/' + iconPath);
throw err;
}
}
if (type === "PNG") {
var buffer = fileType(readChunk.sync(path, 0, 262));
if (buffer === null) {
var err = new Error('Unknown mimetype or bad file for "' + app + '": src/icons/' + iconPath);
throw err;
}
else if (buffer.mime !== 'image/png') {
var err = new Error('Incorrect mimetype "' + buffer.mime + '" when expected PNG for app "' + app + '": src/icons/' + iconPath);
throw err;
}
}
else if (type === "SVG") {
if (!isSvg(fs.readFileSync(path))) {
var err = new Error('Incorrect mimetype when expected SVG for app "' + app + '": src/icons/' + iconPath);
throw err;
}
}
} else {
var err = new Error('Missing file for app "' + app + '": src/icons/' + iconPath);
throw err;
throw err;
}
});
}(app));

@ -85,8 +85,7 @@
"required": true
},
"icon": {
"type": "string",
"required": true
"type": "string"
}
}
}

@ -865,7 +865,6 @@
"3"
],
"html": "<!-- <h1>BigDump: Staggered MySQL Dump Importer ver\\. ([\\d.b]+)\\;version:\\1",
"icon": "default.svg",
"implies": [
"MySQL",
"PHP"
@ -950,14 +949,12 @@
"headers": {
"Server": "Boa\\/?([\\d\\.a-z]+)?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://www.boa.org"
},
"Boba.js": {
"cats": [
"12"
],
"icon": "default.svg",
"implies": "Google Analytics",
"script": "boba(?:\\.min)?\\.js",
"website": "http://boba.space150.com"
@ -1135,7 +1132,6 @@
"cats": [
"1"
],
"icon": "default.svg",
"implies": "PHP",
"meta": {
"generator": "CMSimple( [\\d.]+)?\\;version:\\1"
@ -1882,7 +1878,6 @@
"headers": {
"Server": "DECORUM(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"DedeCMS": {
@ -2358,7 +2353,6 @@
"25"
],
"html": "<link[^>]+?href=\"[^\"]+epoch(?:\\.min)?\\.css",
"icon": "default.svg",
"implies": "D3",
"script": "epoch(?:\\.min)?\\.js",
"website": "http://fastly.github.io/epoch"
@ -2555,7 +2549,6 @@
"headers": {
"Server": "FlashCom/?([\\d\\.]+)?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"Flask": {
@ -2886,7 +2879,6 @@
"<!-- gitphp web interface ([\\d.]+)\\;version:\\1",
"<a href=\"http://www.gitphp.org/\" target=\"_blank\">GitPHP by Chris Han"
],
"icon": "default.svg",
"implies": "PHP",
"website": "http://gitphp.org"
},
@ -2895,7 +2887,6 @@
"47"
],
"html": "Powered by <a href=\"https://gerrit.googlesource.com/gitiles/\">Gitiles<",
"icon": "default.svg",
"implies": [
"Java",
"git"
@ -3278,7 +3269,6 @@
"headers": {
"Server": "^http-kit"
},
"icon": "default.svg",
"implies": "Java",
"website": "http://http-kit.org"
},
@ -3289,7 +3279,6 @@
"headers": {
"Server": "(?:^|[^-])\bHTTP-Server(?: ?/?V?([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"HTTP/2": {
@ -3308,7 +3297,6 @@
"4"
],
"html": "<p>Produced by <a href=\"http://www.haskell.org/haddock/\">Haddock</a> version ([0-9.]+)</p>\\;version:\\1",
"icon": "default.svg",
"script": "haddock-util\\.js",
"website": "http://www.haskell.org/haddock/"
},
@ -3338,7 +3326,6 @@
"headers": {
"Server": "Happy ICS Server(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"implies": "OmniTouch 8660 My Teamwork",
"website": "http://example.com"
},
@ -3652,7 +3639,6 @@
"1"
],
"html": "<(?:link|a href) [^>]+ndxz-studio",
"icon": "default.svg",
"implies": [
"PHP",
"Apache",
@ -3681,7 +3667,6 @@
"headers": {
"Server": "Indy(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://indyproject.org"
},
"InfernoJS": {
@ -4210,7 +4195,6 @@
"headers": {
"X-Powered-By": "Kolibri"
},
"icon": "default.svg",
"meta": {
"generator": "Kolibri"
},
@ -4305,7 +4289,6 @@
"cats": [
"12"
],
"icon": "default.svg",
"script": "lazy(?:\\.browser)?(?:\\.min)?\\.js",
"website": "http://danieltao.com/lazy.js"
},
@ -5003,7 +4986,6 @@
"headers": {
"Server": "MiniServ\\/?([\\d\\.]+)?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://sourceforge.net/projects/miniserv"
},
"Mint": {
@ -5049,7 +5031,6 @@
"headers": {
"Server": "MochiWeb(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://github.com/mochi/mochiweb"
},
"Modernizr": {
@ -5220,7 +5201,6 @@
"headers": {
"Server": "Motion-httpd(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://lavrsen.dk/foswiki/bin/view/Motion"
},
"MotoCMS": {
@ -5960,7 +5940,6 @@
"cats": [
"25"
],
"icon": "default.svg",
"script": "paths(?:\\.min)?\\.js",
"website": "http://github.com/andreaferretti/paths-js"
},
@ -6313,7 +6292,6 @@
"25"
],
"env": "^protovis$",
"icon": "default.svg",
"script": "protovis.*\\.js",
"website": "http://mbostock.github.com/protovis"
},
@ -6448,7 +6426,6 @@
"headers": {
"Server": "RAID HTTPServer(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"RBS Change": {
@ -6558,7 +6535,6 @@
"headers": {
"Server": "Rapid Logic(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"React": {
@ -6663,7 +6639,6 @@
"25"
],
"env": "^Rickshaw$",
"icon": "default.svg",
"implies": "D3",
"script": "rickshaw(?:\\.min)?\\.js",
"website": "http://code.shutterstock.com/rickshaw/"
@ -7033,7 +7008,6 @@
"cats": [
"12"
],
"icon": "default.svg",
"implies": "jQuery",
"script": "select2.*\\.js",
"website": "http://select2.github.io"
@ -7252,7 +7226,6 @@
"headers": {
"Server": "SimpleHTTP(?:/([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"Site Meter": {
@ -8108,7 +8081,6 @@
"25"
],
"env": "^twemoji$",
"icon": "default.svg",
"script": "twemoji(?:\\.min)?\\.js",
"website": "http://twitter.github.io/twemoji/"
},
@ -8428,7 +8400,6 @@
"headers": {
"Server": "Virata-EmWeb(?:/(R?[\\d._]+))?\\;version:\\1"
},
"icon": "default.svg",
"implies": [
"HP"
],
@ -8735,7 +8706,6 @@
"Server": "Winstone Servlet (?:Container|Engine) v?([\\d.]+)?\\;version:\\1",
"X-Powered-By": "Winstone(?:.([\\d.]+))?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://winstone.sourceforge.net"
},
"Wix": {
@ -9323,7 +9293,6 @@
"headers": {
"Server": "dwhttpd\\/?([\\d\\.a-z]+)?\\;version:\\1"
},
"icon": "default.svg",
"website": "http://example.com"
},
"e107": {
@ -9356,7 +9325,6 @@
"headers": {
"Server": "\beHTTP(?: v?([\\d\\.]+))?\\;version:\\1"
},
"icon": "default.svg",
"implies": "HP ProCurve",
"website": "http://example.com"
},
@ -9418,7 +9386,6 @@
"47"
],
"html": "<p>Powered by <a[^>]+>GitList ([\\d.]+)\\;version:\\1",
"icon": "default.svg",
"implies": [
"PHP",
"git"
@ -9553,7 +9520,6 @@
"cats": [
"25"
],
"icon": "default.svg",
"implies": "jQuery",
"script": "jquery\\.sparkline.*\\.js",
"website": "http://omnipotent.net/jquery.sparkline/"
@ -9999,7 +9965,6 @@
"25"
],
"env": "^Shine$",
"icon": "default.svg",
"script": "shine(?:\\.min)?\\.js",
"website": "http://bigspaceship.github.io/shine.js/"
},
@ -10107,7 +10072,6 @@
"1"
],
"html": "powered by <a href=\"[^>]+viennacms",
"icon": "default.svg",
"website": "http://www.viennacms.nl"
},
"webEdition": {
@ -10151,7 +10115,6 @@
],
"env": "^xChart$",
"html": "<link[^>]* href=\"[^\"]*xcharts(?:\\.min)?\\.css",
"icon": "default.svg",
"implies": "D3",
"script": "xcharts\\.js",
"website": "http://tenxer.github.io/xcharts/"

@ -112,7 +112,7 @@
'<div class="wappalyzer-app' + ( first ? ' wappalyzer-first' : '' ) + '">' +
'<a target="_blank" class="wappalyzer-application" href="' + w.config.websiteURL + 'applications/' + app.toLowerCase().replace(/ /g, '-').replace(/[^a-z0-9-]/g, '') + '">' +
'<strong>' +
'<img src="' + w.config.websiteURL + 'images/icons/' + w.apps[app].icon + '" width="16" height="16"/> ' + app +
'<img src="' + w.config.websiteURL + 'images/icons/' + (w.apps[app].icon || 'default.svg') + '" width="16" height="16"/> ' + app +
'</strong>' +
'</a>';

@ -88,7 +88,7 @@
name: app,
confidence: wappalyzer.detected[url][app].confidenceTotal.toString(),
version: wappalyzer.detected[url][app].version,
icon: wappalyzer.apps[app].icon,
icon: wappalyzer.apps[app].icon || 'default.svg',
website: wappalyzer.apps[app].website,
categories: cats
});

@ -214,7 +214,7 @@
w.driver.categoryOrder.forEach(function(match) {
for ( appName in w.detected[url] ) {
w.apps[appName].cats.forEach(function(cat) {
var icon = w.apps[appName].icon;
var icon = w.apps[appName].icon || 'default.svg';
if ( cat == match && !found ) {
if ( /\.svg$/i.test(icon) ) {

@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function() {
html =
'<div class="detected-app">' +
'<a target="_blank" href="https://wappalyzer.com/applications/' + slugify(appName) + '">' +
'<img src="images/icons/' + response.apps[appName].icon + '"/>' +
'<img src="images/icons/' + (response.apps[appName].icon || 'default.svg') + '"/>' +
'<span class="label"><span class="name">' + appName + '</span>' + ( version ? ' ' + version : '' ) + ( confidence < 100 ? ' (' + confidence + '% sure)' : '' ) + '</span>' +
'</a>';

Loading…
Cancel
Save