Work on bookmarklet driver

main
ElbertF 13 years ago
parent 8e3cffde2d
commit 70ed691ffa

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

@ -2,11 +2,6 @@
<head> <head>
<link rel="stylesheet" type="text/css" href="css/wappalyzer.css"/> <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> </head>
<body> <body>
<div id="overlay"></div> <div id="overlay"></div>

@ -17,7 +17,7 @@
init: function() { init: function() {
var env = new Array; var env = new Array;
for ( var i in top ) env.push(i); for ( i in window ) env.push(i);
window.document.addEventListener('DOMContentLoaded', function() { window.document.addEventListener('DOMContentLoaded', function() {
w.analyze(top.location.host, top.location.href, { w.analyze(top.location.host, top.location.href, {
@ -33,7 +33,11 @@
displayApps: function() { displayApps: function() {
var url = top.location.href; 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 ) { if ( w.detected[url] != null && w.detected[url].length ) {
w.detected[url].map(function(app, i) { 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>'; 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;
}, },
/** /**

Loading…
Cancel
Save