From f8908e4a7fb3bf32b0fa4bdff0664bde0951d3ad Mon Sep 17 00:00:00 2001 From: ElbertF Date: Sat, 7 Jan 2012 15:01:13 +1100 Subject: [PATCH] Work on bookmarklet driver --- drivers/bookmarklet/bookmarklet.html | 48 +++++++++++++++++++++ drivers/bookmarklet/css/wappalyzer.css | 43 +++++++++++++++++++ drivers/bookmarklet/images/icons | 1 + drivers/bookmarklet/index.html | 14 +++++++ drivers/bookmarklet/js/apps.js | 1 + drivers/bookmarklet/js/driver.js | 58 ++++++++++++++++++++++++++ drivers/bookmarklet/js/lib | 1 + drivers/bookmarklet/js/wappalyzer.js | 1 + 8 files changed, 167 insertions(+) create mode 100644 drivers/bookmarklet/bookmarklet.html create mode 100644 drivers/bookmarklet/css/wappalyzer.css create mode 120000 drivers/bookmarklet/images/icons create mode 100644 drivers/bookmarklet/index.html create mode 120000 drivers/bookmarklet/js/apps.js create mode 100644 drivers/bookmarklet/js/driver.js create mode 120000 drivers/bookmarklet/js/lib create mode 120000 drivers/bookmarklet/js/wappalyzer.js diff --git a/drivers/bookmarklet/bookmarklet.html b/drivers/bookmarklet/bookmarklet.html new file mode 100644 index 000000000..a169cee41 --- /dev/null +++ b/drivers/bookmarklet/bookmarklet.html @@ -0,0 +1,48 @@ + + + + + Wappalyzer + + + + + + + + + Wappalyzer + + diff --git a/drivers/bookmarklet/css/wappalyzer.css b/drivers/bookmarklet/css/wappalyzer.css new file mode 100644 index 000000000..eaa992e4f --- /dev/null +++ b/drivers/bookmarklet/css/wappalyzer.css @@ -0,0 +1,43 @@ +body { + color: #fff; + font-family: Arial, sans-serif; + font-size: 14px; + margin: 0; + padding: 10px; +} + +#overlay { + background: #000; + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + left: 0; + height: 100%; + opacity: .5; filter: alpha(opacity = 50); + position: absolute; + top: 0; + width: 100%; +} + +#apps { + position: absolute; +} + + #apps img { + vertical-align: middle; + } + + #apps a { + color: #fff; + display: block; + text-decoration: none; + } + + #apps a:hover { + text-decoration: underline; + } + + #apps .app { + background: #000; + padding: 10px; + } diff --git a/drivers/bookmarklet/images/icons b/drivers/bookmarklet/images/icons new file mode 120000 index 000000000..e0f9d2240 --- /dev/null +++ b/drivers/bookmarklet/images/icons @@ -0,0 +1 @@ +../../../share/images/icons \ No newline at end of file diff --git a/drivers/bookmarklet/index.html b/drivers/bookmarklet/index.html new file mode 100644 index 000000000..a10025c8d --- /dev/null +++ b/drivers/bookmarklet/index.html @@ -0,0 +1,14 @@ + + + + + + + + + +
+ +
+ + diff --git a/drivers/bookmarklet/js/apps.js b/drivers/bookmarklet/js/apps.js new file mode 120000 index 000000000..bc2cad71e --- /dev/null +++ b/drivers/bookmarklet/js/apps.js @@ -0,0 +1 @@ +../../../share/js/apps.js \ No newline at end of file diff --git a/drivers/bookmarklet/js/driver.js b/drivers/bookmarklet/js/driver.js new file mode 100644 index 000000000..29b33cf33 --- /dev/null +++ b/drivers/bookmarklet/js/driver.js @@ -0,0 +1,58 @@ +(function() { + if ( wappalyzer == null ) return; + + var w = wappalyzer; + + w.driver = { + /** + * Log messages to console + */ + log: function(args) { + if ( console != null ) console[args.type](args.message); + }, + + /** + * Initialize + */ + init: function() { + var env = new Array; + + for ( var i in top ) env.push(i); + + window.document.addEventListener('DOMContentLoaded', function() { + w.analyze(top.location.host, top.location.href, { + html: top.document.body.innerHTML, + env: env + }); + }); + }, + + /** + * Display apps + */ + displayApps: function() { + var url = top.location.href; + + document.getElementById('apps').innerHTML = ''; if ( w.detected[url] != null && w.detected[url].length ) { + w.detected[url].map(function(app, i) { + document.getElementById('apps').innerHTML += + '
' + + '' + + ' ' + app + + '' + + '
' + ; + }); + } + }, + + /** + * Go to URL + */ + goToURL: function(args) { + window.open(args.url); + } + }; + + w.init(); +})(); diff --git a/drivers/bookmarklet/js/lib b/drivers/bookmarklet/js/lib new file mode 120000 index 000000000..523d915ca --- /dev/null +++ b/drivers/bookmarklet/js/lib @@ -0,0 +1 @@ +../../../share/js/lib \ No newline at end of file diff --git a/drivers/bookmarklet/js/wappalyzer.js b/drivers/bookmarklet/js/wappalyzer.js new file mode 120000 index 000000000..ad99b3d0c --- /dev/null +++ b/drivers/bookmarklet/js/wappalyzer.js @@ -0,0 +1 @@ +../../../share/js/wappalyzer.js \ No newline at end of file