Fix for bookmarklet driver

main
ElbertF 13 years ago
parent 10978b3218
commit 563d5e9539

@ -40,42 +40,55 @@
<div id="bookmarklet-code" style="display: none"> <div id="bookmarklet-code" style="display: none">
(function() { (function() {
var exists = window.document.getElementById('wappalyzer-container'); var
d = document,
e = d.getElementById('wappalyzer-container')
;
if ( exists !== null ) { window.document.body.removeChild(exists); } if ( e !== null ) { d.body.removeChild(e); }
var var
url = 'http://wappalyzer.com/bookmarklet/', u = 'http://wappalyzer.com/bookmarklet/',
d = window.document, t = new Date().getTime(),
container = d.createElement('div'), c = d.createElement('div'),
pending = d.createElement('div'), p = d.createElement('div'),
style = d.createElement('link'), l = d.createElement('link'),
script1 = d.createElement('script'), s = d.createElement('script')
script2 = d.createElement('script'),
script3 = d.createElement('script')
; ;
container.setAttribute('id', 'wappalyzer-container'); c.setAttribute('id', 'wappalyzer-container');
l.setAttribute('rel', 'stylesheet');
l.setAttribute('href', u + 'css/wappalyzer.css');
d.head.appendChild(l);
p.setAttribute('id', 'wappalyzer-pending');
p.setAttribute('style', 'background-image: url(' + u + 'images/pending.gif) !important');
c.appendChild(p);
s.setAttribute('src', u + 'js/wappalyzer.js?' + t);
s.onload = function() {
s = d.createElement('script');
pending .setAttribute('id', 'wappalyzer-pending'); s.setAttribute('src', u + 'js/apps.js?' + t);
pending .setAttribute('style', 'background-image: url(' + url + 'images/pending.gif) !important');
style.setAttribute('rel', 'stylesheet'); s.onload = function() {
style.setAttribute('href', url + 'css/wappalyzer.css'); s = d.createElement('script');
script1.setAttribute('src', url + 'js/wappalyzer.js'); s.setAttribute('src', u + 'js/driver.js?' + t);
script2.setAttribute('src', url + 'js/apps.js');
script3.setAttribute('src', url + 'js/driver.js');
d.head.appendChild(style); c.appendChild(s);
};
container.appendChild(pending); c.appendChild(s);
};
container.appendChild(script1); c.appendChild(s);
container.appendChild(script2);
container.appendChild(script3);
d.body.appendChild(container); d.body.appendChild(c);
})(); })();
</div> </div>

@ -70,10 +70,7 @@
for ( i in window ) { env.push(i); } for ( i in window ) { env.push(i); }
w.analyze(domain, url, { w.analyze(domain, url, { html: d.documentElement.innerHTML, env: env });
html: d.documentElement.innerHTML,
env: env
});
}, },
getResponseHeaders: function() { getResponseHeaders: function() {
@ -101,9 +98,7 @@
} }
}); });
w.analyze(domain, url, { w.analyze(domain, url, { headers: responseHeaders });
headers: responseHeaders
});
} }
} }
} }
@ -115,6 +110,8 @@
* Display apps * Display apps
*/ */
displayApps: function() { displayApps: function() {
w.log('func: diplayApps');
var var
category, category,
html html
@ -127,7 +124,7 @@
'<div id="wappalyzer-apps">' '<div id="wappalyzer-apps">'
; ;
if ( false && w.detected[url] != null && w.detected[url].length ) { if ( w.detected[url] != null && w.detected[url].length ) {
w.detected[url].map(function(app, i) { w.detected[url].map(function(app, i) {
html += html +=
'<div class="wappalyzer-app' + ( !i ? ' wappalyzer-first' : '' ) + '">' + '<div class="wappalyzer-app' + ( !i ? ' wappalyzer-first' : '' ) + '">' +