diff --git a/.windows_zip/Download 7-Zip.hta b/.windows_zip/Download 7-Zip.hta
deleted file mode 100644
index b8ff9aa72..000000000
--- a/.windows_zip/Download 7-Zip.hta
+++ /dev/null
@@ -1,98 +0,0 @@
-
Download 7-zip (command line version)
The download will be started automatically.
Place the file in the same folder as Wappalyzer.
License | Source code
-
-
-
\ No newline at end of file
diff --git a/drivers/bookmarklet/js/wappalyzer.js b/drivers/bookmarklet/js/wappalyzer.js
index e61da003b..2bc0c3165 100644
--- a/drivers/bookmarklet/js/wappalyzer.js
+++ b/drivers/bookmarklet/js/wappalyzer.js
@@ -24,6 +24,26 @@ var wappalyzer = (function() {
return w.driver[func](args);
};
+ /**
+ * Parse apps.json patterns
+ */
+ var parse = function(patterns) {
+ var parsed = [];
+
+ // Convert single patterns to an array
+ if ( typeof patterns === 'string' ) {
+ patterns = [ patterns ];
+ }
+
+ patterns.map(function(pattern) {
+ parsed.push({
+ regex: new RegExp(pattern.replace('/', '\\\/'), 'i') // Escape slashes in regular expression
+ });
+ });
+
+ return parsed;
+ };
+
/**
* Main script
*/
@@ -91,7 +111,7 @@ var wappalyzer = (function() {
*/
analyze: function(hostname, url, data) {
var
- i, j, app, confidence, type, regex, regexMeta, regexScript, match, content, meta, header,
+ i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header,
profiler = {
regexCount: 0,
startTime: new Date().getTime()
@@ -115,7 +135,6 @@ var wappalyzer = (function() {
w.detected[url] = {};
}
- appLoop:
for ( app in w.apps ) {
// Skip if the app has already been detected
if ( w.detected[url].hasOwnProperty(app) || apps.indexOf(app) !== -1 ) {
@@ -129,15 +148,13 @@ var wappalyzer = (function() {
switch ( type ) {
case 'url':
- regex = new RegExp(w.apps[app][type].replace('/', '\\\/'), 'i');
-
- profiler.regexCount ++;
-
- if ( regex.test(url) ) {
- apps[app] = confidence;
+ parse(w.apps[app][type]).map(function(pattern) {
+ profiler.regexCount ++;
- continue appLoop;
- }
+ if ( pattern.regex.test(url) ) {
+ apps[app] = confidence;
+ }
+ });
break;
case 'html':
@@ -145,15 +162,13 @@ var wappalyzer = (function() {
break;
}
- regex = new RegExp(w.apps[app][type].replace('/', '\\\/'), 'i');
-
- profiler.regexCount ++;
-
- if ( regex.test(data[type]) ) {
- apps[app] = confidence;
+ parse(w.apps[app][type]).map(function(pattern) {
+ profiler.regexCount ++;
- continue appLoop;
- }
+ if ( pattern.regex.test(data[type]) ) {
+ apps[app] = confidence;
+ }
+ });
break;
case 'script':
@@ -161,20 +176,19 @@ var wappalyzer = (function() {
break;
}
- regex = new RegExp(w.apps[app][type].replace('/', '\\\/'), 'i');
regexScript = new RegExp('