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

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

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

@ -112,7 +112,7 @@
'<div class="wappalyzer-app' + ( first ? ' wappalyzer-first' : '' ) + '">' + '<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, '') + '">' + '<a target="_blank" class="wappalyzer-application" href="' + w.config.websiteURL + 'applications/' + app.toLowerCase().replace(/ /g, '-').replace(/[^a-z0-9-]/g, '') + '">' +
'<strong>' + '<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>' + '</strong>' +
'</a>'; '</a>';

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

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

@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function() {
html = html =
'<div class="detected-app">' + '<div class="detected-app">' +
'<a target="_blank" href="https://wappalyzer.com/applications/' + slugify(appName) + '">' + '<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>' + '<span class="label"><span class="name">' + appName + '</span>' + ( version ? ' ' + version : '' ) + ( confidence < 100 ? ' (' + confidence + '% sure)' : '' ) + '</span>' +
'</a>'; '</a>';

Loading…
Cancel
Save