From 2431a13f5619a68f243765599f8b3161a7f73cc6 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Thu, 10 Jan 2013 20:27:38 +1100 Subject: [PATCH] Check regexp validity, improved several patterns --- .../bookmarklet/images/icons/Google PageSpeed.png | Bin 0 -> 809 bytes drivers/bookmarklet/js/wappalyzer.js | 8 +++++++- drivers/bookmarklet/json | 14 ++++++++++---- drivers/chrome/apps.json | 14 ++++++++++---- drivers/chrome/images/icons/Google PageSpeed.png | Bin 0 -> 809 bytes drivers/chrome/js/wappalyzer.js | 8 +++++++- drivers/firefox-jetpack/data/apps.json | 14 ++++++++++---- .../images/icons/Google PageSpeed.png | Bin 0 -> 809 bytes drivers/firefox-jetpack/lib/wappalyzer.js | 8 +++++++- drivers/firefox/content/apps.json | 14 ++++++++++---- drivers/firefox/content/js/wappalyzer.js | 8 +++++++- .../skin/images/icons/Google PageSpeed.png | Bin 0 -> 809 bytes drivers/html/apps.json | 14 ++++++++++---- drivers/html/images/icons/Google PageSpeed.png | Bin 0 -> 809 bytes drivers/html/js/wappalyzer.js | 8 +++++++- drivers/php/apps.json | 14 ++++++++++---- drivers/php/js/wappalyzer.js | 8 +++++++- share/apps.json | 10 ++++++---- share/js/wappalyzer.js | 8 +++++++- 19 files changed, 115 insertions(+), 35 deletions(-) create mode 100644 drivers/bookmarklet/images/icons/Google PageSpeed.png create mode 100644 drivers/chrome/images/icons/Google PageSpeed.png create mode 100644 drivers/firefox-jetpack/images/icons/Google PageSpeed.png create mode 100644 drivers/firefox/skin/images/icons/Google PageSpeed.png create mode 100644 drivers/html/images/icons/Google PageSpeed.png diff --git a/drivers/bookmarklet/images/icons/Google PageSpeed.png b/drivers/bookmarklet/images/icons/Google PageSpeed.png new file mode 100644 index 0000000000000000000000000000000000000000..6d482a8388c7be1377dc1d4cb69ed9e4819f4b90 GIT binary patch literal 809 zcmV+^1J?YBP)eYikyo#)dFWipSk5O$pWWS?JpbJ?;%Q(6VCUH?re4KcTf`n3 zs}pHS=;(y%bab0o#|wvF`?)Ac+kFzbIXQ2aeqBB_Yx}G;l;XoPY2hCvPgE}kPR-kB z`)H#~=u~Chuf4hz_@kr>U1@G*nbUEHSKS*40aHrZh%{Fl-C>f zedy>wUtDh&Jo#nG*Ss4_I59P5g_rjN(AyPZJnKu&v1n>-5-ZhAo2k7c0E=Js=*jlm zS_E=+B(sL*6mIDf0rd2G~V4(*JPZiQ-~T$(O&_qRF_K;S?a zfbYhStW)jQGOFFk*_ zdvoddhD|mF7p%AiQA__Q`nr_&bhR8%b(D&O#4>mNw)WIV_Fv&EDZUvT{xRD?K)kT)1%hi5oV+(#ZP]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/chrome/apps.json b/drivers/chrome/apps.json index 05e4a18f6..000a27d19 100644 --- a/drivers/chrome/apps.json +++ b/drivers/chrome/apps.json @@ -680,6 +680,10 @@ "cats": [ 5 ], "script": "(maps\\.google\\.com/maps\\?file=api(&v=([\\d\\.]+))?|maps\\.google\\.com/maps/api/staticmap)\\;version:API v\\3" }, + "Google PageSpeed": { + "cats": [ 23, 33 ], + "headers": { "X-Mod-Pagespeed": ".*" } + }, "Google Sites": { "cats": [ 1 ], "url": "sites.google.com" @@ -1159,7 +1163,7 @@ "New Relic": { "cats": [ 10 ], "html": "]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/chrome/images/icons/Google PageSpeed.png b/drivers/chrome/images/icons/Google PageSpeed.png new file mode 100644 index 0000000000000000000000000000000000000000..6d482a8388c7be1377dc1d4cb69ed9e4819f4b90 GIT binary patch literal 809 zcmV+^1J?YBP)eYikyo#)dFWipSk5O$pWWS?JpbJ?;%Q(6VCUH?re4KcTf`n3 zs}pHS=;(y%bab0o#|wvF`?)Ac+kFzbIXQ2aeqBB_Yx}G;l;XoPY2hCvPgE}kPR-kB z`)H#~=u~Chuf4hz_@kr>U1@G*nbUEHSKS*40aHrZh%{Fl-C>f zedy>wUtDh&Jo#nG*Ss4_I59P5g_rjN(AyPZJnKu&v1n>-5-ZhAo2k7c0E=Js=*jlm zS_E=+B(sL*6mIDf0rd2G~V4(*JPZiQ-~T$(O&_qRF_K;S?a zfbYhStW)jQGOFFk*_ zdvoddhD|mF7p%AiQA__Q`nr_&bhR8%b(D&O#4>mNw)WIV_Fv&EDZUvT{xRD?K)kT)1%hi5oV+(#ZP]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/firefox-jetpack/images/icons/Google PageSpeed.png b/drivers/firefox-jetpack/images/icons/Google PageSpeed.png new file mode 100644 index 0000000000000000000000000000000000000000..6d482a8388c7be1377dc1d4cb69ed9e4819f4b90 GIT binary patch literal 809 zcmV+^1J?YBP)eYikyo#)dFWipSk5O$pWWS?JpbJ?;%Q(6VCUH?re4KcTf`n3 zs}pHS=;(y%bab0o#|wvF`?)Ac+kFzbIXQ2aeqBB_Yx}G;l;XoPY2hCvPgE}kPR-kB z`)H#~=u~Chuf4hz_@kr>U1@G*nbUEHSKS*40aHrZh%{Fl-C>f zedy>wUtDh&Jo#nG*Ss4_I59P5g_rjN(AyPZJnKu&v1n>-5-ZhAo2k7c0E=Js=*jlm zS_E=+B(sL*6mIDf0rd2G~V4(*JPZiQ-~T$(O&_qRF_K;S?a zfbYhStW)jQGOFFk*_ zdvoddhD|mF7p%AiQA__Q`nr_&bhR8%b(D&O#4>mNw)WIV_Fv&EDZUvT{xRD?K)kT)1%hi5oV+(#ZP]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/firefox/content/js/wappalyzer.js b/drivers/firefox/content/js/wappalyzer.js index e5791c7d5..44c7cf0ff 100644 --- a/drivers/firefox/content/js/wappalyzer.js +++ b/drivers/firefox/content/js/wappalyzer.js @@ -89,7 +89,13 @@ var wappalyzer = (function() { attrs[attr[0]] = attr[1]; } } else { - attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + try { + attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + } catch (e) { + attrs.regex = new RegExp(); + + w.log(e + ': ' + attr, 'warn'); + } } }); diff --git a/drivers/firefox/skin/images/icons/Google PageSpeed.png b/drivers/firefox/skin/images/icons/Google PageSpeed.png new file mode 100644 index 0000000000000000000000000000000000000000..6d482a8388c7be1377dc1d4cb69ed9e4819f4b90 GIT binary patch literal 809 zcmV+^1J?YBP)eYikyo#)dFWipSk5O$pWWS?JpbJ?;%Q(6VCUH?re4KcTf`n3 zs}pHS=;(y%bab0o#|wvF`?)Ac+kFzbIXQ2aeqBB_Yx}G;l;XoPY2hCvPgE}kPR-kB z`)H#~=u~Chuf4hz_@kr>U1@G*nbUEHSKS*40aHrZh%{Fl-C>f zedy>wUtDh&Jo#nG*Ss4_I59P5g_rjN(AyPZJnKu&v1n>-5-ZhAo2k7c0E=Js=*jlm zS_E=+B(sL*6mIDf0rd2G~V4(*JPZiQ-~T$(O&_qRF_K;S?a zfbYhStW)jQGOFFk*_ zdvoddhD|mF7p%AiQA__Q`nr_&bhR8%b(D&O#4>mNw)WIV_Fv&EDZUvT{xRD?K)kT)1%hi5oV+(#ZP]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/html/images/icons/Google PageSpeed.png b/drivers/html/images/icons/Google PageSpeed.png new file mode 100644 index 0000000000000000000000000000000000000000..6d482a8388c7be1377dc1d4cb69ed9e4819f4b90 GIT binary patch literal 809 zcmV+^1J?YBP)eYikyo#)dFWipSk5O$pWWS?JpbJ?;%Q(6VCUH?re4KcTf`n3 zs}pHS=;(y%bab0o#|wvF`?)Ac+kFzbIXQ2aeqBB_Yx}G;l;XoPY2hCvPgE}kPR-kB z`)H#~=u~Chuf4hz_@kr>U1@G*nbUEHSKS*40aHrZh%{Fl-C>f zedy>wUtDh&Jo#nG*Ss4_I59P5g_rjN(AyPZJnKu&v1n>-5-ZhAo2k7c0E=Js=*jlm zS_E=+B(sL*6mIDf0rd2G~V4(*JPZiQ-~T$(O&_qRF_K;S?a zfbYhStW)jQGOFFk*_ zdvoddhD|mF7p%AiQA__Q`nr_&bhR8%b(D&O#4>mNw)WIV_Fv&EDZUvT{xRD?K)kT)1%hi5oV+(#ZP]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1433,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1606,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1705,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "twitter\\.github\\.com/bootstrap", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/drivers/php/js/wappalyzer.js b/drivers/php/js/wappalyzer.js index e5791c7d5..44c7cf0ff 100644 --- a/drivers/php/js/wappalyzer.js +++ b/drivers/php/js/wappalyzer.js @@ -89,7 +89,13 @@ var wappalyzer = (function() { attrs[attr[0]] = attr[1]; } } else { - attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + try { + attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + } catch (e) { + attrs.regex = new RegExp(); + + w.log(e + ': ' + attr, 'warn'); + } } }); diff --git a/share/apps.json b/share/apps.json index c4798821e..000a27d19 100644 --- a/share/apps.json +++ b/share/apps.json @@ -1163,7 +1163,7 @@ "New Relic": { "cats": [ 10 ], "html": "]+>(var NREUMQ=NREUMQ|if \\(!NREUMQ\\.f)", - "env": "^NREUMQ$" + "env": "^NREUM" }, "Nginx": { "cats": [ 22 ], @@ -1437,7 +1437,7 @@ "reCAPTCHA": { "cats": [ 16 ], "script": "(api-secure\\.recaptcha\\.net|recaptcha_ajax\\.js)", - "html": "]+id=\\\"recaptcha_image", + "html": "(]+id=\\\"recaptcha_image|]+recaptcha|document\\.getElementById\\('recaptcha)", "env": "^Recaptcha$" }, "Red Hat": { @@ -1610,7 +1610,9 @@ }, "Squarespace": { "cats": [ 1 ], - "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID" + "html": "Squarespace\\.Constants\\.CURRENT_MODULE_ID", + "headers": { "X-ServedBy": "squarespace" }, + "env": "^Squarespace" }, "Squiz Matrix": { "cats": [ 1 ], @@ -1709,7 +1711,7 @@ }, "Twitter Bootstrap": { "cats": [ 18 ], - "script": "(twitter\\.github\\.com/bootstrap|bootstrap(.js|.min.js))", + "script": "(twitter\\.github\\.com/bootstrap|bootstrap(\\.js|\\.min\\.js))", "html": "]+bootstrap[^>]+css", "env": "^Twipsy$\\;confidence:50" }, diff --git a/share/js/wappalyzer.js b/share/js/wappalyzer.js index e5791c7d5..44c7cf0ff 100644 --- a/share/js/wappalyzer.js +++ b/share/js/wappalyzer.js @@ -89,7 +89,13 @@ var wappalyzer = (function() { attrs[attr[0]] = attr[1]; } } else { - attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + try { + attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression + } catch (e) { + attrs.regex = new RegExp(); + + w.log(e + ': ' + attr, 'warn'); + } } });