From 17dc933d0dab6041e6179e1eca146c60a76dd617 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sun, 9 Jun 2013 09:07:16 +1000 Subject: [PATCH] Set upper HTML length limit in Chrome driver --- drivers/bookmarklet/js/wappalyzer.js | 2 ++ drivers/chrome/js/content.js | 14 +++++++++++--- drivers/chrome/js/wappalyzer.js | 2 ++ drivers/chrome/manifest.json | 2 +- drivers/firefox-jetpack/lib/wappalyzer.js | 2 ++ drivers/firefox/content/js/wappalyzer.js | 2 ++ drivers/html/js/wappalyzer.js | 2 ++ drivers/php/js/wappalyzer.js | 2 ++ share/js/wappalyzer.js | 2 ++ 9 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/bookmarklet/js/wappalyzer.js b/drivers/bookmarklet/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/bookmarklet/js/wappalyzer.js +++ b/drivers/bookmarklet/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/drivers/chrome/js/content.js b/drivers/chrome/js/content.js index 992396362..e160070dd 100644 --- a/drivers/chrome/js/content.js +++ b/drivers/chrome/js/content.js @@ -1,9 +1,15 @@ (function() { var c = { init: function() { + var html = document.documentElement.outerHTML; + c.log('init'); - chrome.extension.sendRequest({ id: 'analyze', subject: { html: document.documentElement.outerHTML } }); + if ( html.length > 50000 ) { + html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length); + } + + chrome.extension.sendRequest({ id: 'analyze', subject: { html: html } }); c.getEnvironmentVars(); }, @@ -13,6 +19,8 @@ }, getEnvironmentVars: function() { + var container, script; + c.log('getEnvironmentVars'); if ( typeof document.documentElement.innerHTML === 'undefined' ) { @@ -20,12 +28,12 @@ } try { - var container = document.createElement('wappalyzerData'); + container = document.createElement('wappalyzerData'); container.setAttribute('id', 'wappalyzerData'); container.setAttribute('style', 'display: none'); - var script = document.createElement('script'); + script = document.createElement('script'); script.setAttribute('id', 'wappalyzerEnvDetection'); script.setAttribute('src', chrome.extension.getURL('js/inject.js')); diff --git a/drivers/chrome/js/wappalyzer.js b/drivers/chrome/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/chrome/js/wappalyzer.js +++ b/drivers/chrome/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/drivers/chrome/manifest.json b/drivers/chrome/manifest.json index c85c58e61..25db90245 100644 --- a/drivers/chrome/manifest.json +++ b/drivers/chrome/manifest.json @@ -1,7 +1,7 @@ { "name": "Wappalyzer", "homepage_url": "http://wappalyzer.com?utm_source=chrome&utm_medium=context&utm_campaign=extensions", "description": "Identifies software on the web", - "version": "2.23", + "version": "2.24", "default_locale": "en", "manifest_version": 2, "icons": { diff --git a/drivers/firefox-jetpack/lib/wappalyzer.js b/drivers/firefox-jetpack/lib/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/firefox-jetpack/lib/wappalyzer.js +++ b/drivers/firefox-jetpack/lib/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/drivers/firefox/content/js/wappalyzer.js b/drivers/firefox/content/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/firefox/content/js/wappalyzer.js +++ b/drivers/firefox/content/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/drivers/html/js/wappalyzer.js b/drivers/html/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/html/js/wappalyzer.js +++ b/drivers/html/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/drivers/php/js/wappalyzer.js b/drivers/php/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/drivers/php/js/wappalyzer.js +++ b/drivers/php/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex); diff --git a/share/js/wappalyzer.js b/share/js/wappalyzer.js index 3bb3d9ad2..fa651e966 100644 --- a/share/js/wappalyzer.js +++ b/share/js/wappalyzer.js @@ -299,6 +299,8 @@ var wappalyzer = (function() { break; } + w.log('xxxxxxxxxxxxx'+data.html.length); + parse(w.apps[app][type]).map(function(pattern) { profiler.checkPoint(app, type, pattern.regex);