Work on bookmarklet driver

main
ElbertF 13 years ago
parent 8e3cffde2d
commit 70ed691ffa

@ -28,13 +28,17 @@
<body>
<a href="javascript:
(function() {
var container = document.createElement('div');
container.setAttribute('id', 'wappalyzer-container');
var iframe = document.createElement('iframe');
iframe.setAttribute('id', 'wappalyzer-bookmarklet');
iframe.setAttribute('id', 'wappalyzer');
iframe.setAttribute('allowTransparency', 'yes');
iframe.setAttribute('frameborder', 'no');
iframe.setAttribute('height', '10');
iframe.setAttribute('src', 'http://wappalyzer.com/bookmarklet/2/index.html');
/*iframe.setAttribute('src', 'about:blank');*/
iframe.setAttribute('height', '300');
iframe.setAttribute('width', '220');
iframe.setAttribute('style', '
margin: 0 0 20px 20px;
@ -43,7 +47,19 @@
top: 20px;
');
document.body.appendChild(iframe);
container.appendChild(iframe);
document.body.appendChild(container);
iframe.body.innerHTML = 'x';
var script1 = document.createElement('script');
var script2 = document.createElement('script');
var script3 = document.createElement('script');
script1.setAttribute('src', 'http://wappalyzer.com/bookmarklet/2/js/wappalyzer.js');
script2.setAttribute('src', 'http://wappalyzer.com/bookmarklet/2/js/apps.js');
script3.setAttribute('src', 'http://wappalyzer.com/bookmarklet/2/js/driver.js');
})();
void(0);

@ -2,11 +2,6 @@
<head>
<link rel="stylesheet" type="text/css" href="css/wappalyzer.css"/>
<script type="text/javascript" src="js/lib/jquery.min.js"></script>
<script type="text/javascript" src="js/wappalyzer.js"></script>
<script type="text/javascript" src="js/apps.js"></script>
<script type="text/javascript" src="js/driver.js"></script>
</head>
<body>
<div id="overlay"></div>

@ -17,7 +17,7 @@
init: function() {
var env = new Array;
for ( var i in top ) env.push(i);
for ( i in window ) env.push(i);
window.document.addEventListener('DOMContentLoaded', function() {
w.analyze(top.location.host, top.location.href, {
@ -33,7 +33,11 @@
displayApps: function() {
var url = top.location.href;
$('#apps').html('<a id="close" href="javascript: $(\'#wappalyzer-bookmarklet\', top.document.body).remove();">Close</a>');
document.getElementById('wappalyzer-iframe').contentDocument.body.innerHTML =
'<a id="close" href="javascript: document.removeChild(document.getElementById(\'wappalyzer-container\')); void(0);">' +
'Close' +
'</a>'
;
if ( w.detected[url] != null && w.detected[url].length ) {
w.detected[url].map(function(app, i) {
@ -60,9 +64,9 @@
html = '<div class="app first" style="text-align: center;"><em>No applications detected</em></div>';
}
$('#apps').append(html);
document.getElementById('wappalyzer-iframe').contentDocument.body.innerHTML += html;
$('#wappalyzer-bookmarklet', top.document.body).height($('#apps').height() + 2);
document.getElementById('wappalyzer-iframe').style.height = 300;
},
/**