diff --git a/README.md b/README.md
index 910a733cd..7294643a0 100644
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ want to port Wappalyzer to a new platform.
**Bookmarklet**
-Work in progress.
+Beta version available for testing at [wappalyzer.com/bookmarklet](http://wappalyzer.com/bookmarklet).
Screenshot
diff --git a/drivers/bookmarklet/bookmarklet.html b/drivers/bookmarklet/bookmarklet.html
deleted file mode 100644
index bae7d0099..000000000
--- a/drivers/bookmarklet/bookmarklet.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
- Wappalyzer
-
-
-
-
-
-
-
-
-
-
- Wappalyzer
-
-
diff --git a/drivers/bookmarklet/css/wappalyzer.css b/drivers/bookmarklet/css/wappalyzer.css
index 39314fc05..fe86b5fdf 100644
--- a/drivers/bookmarklet/css/wappalyzer.css
+++ b/drivers/bookmarklet/css/wappalyzer.css
@@ -1,73 +1,111 @@
-html {
- overflow: hidden;
+div#wappalyzer-container * {
+ background-color: transparent !important;
+ border: none !important;
+ border-spacing: 0 !important;
+ color: inherit !important;
+ font-size: inherit !important;
+ font-weight: inherit !important;
+ font-family: inherit !important;
+ font-style: inherit !important;
+ line-height: inherit !important;
+ list-style: none inside !important;
+ margin: 0 !important;
+ outline: none !important;
+ padding: 0 !important;
+ text-align: inherit !important;
+ text-decoration: none !important;
+ white-space: inherit !important;
}
-body {
- color: #000;
- font-family: Arial, sans-serif;
- font-size: 13px;
- line-height: 1.5em;
- margin: 0;
+#wappalyzer-container {
+ background: #fff !important;
+ border: 1px solid #999;
+ box-shadow: 0 0 10px rgba(0, 0, 0, .2) !important;
+ color: #333 !important;
+ font-family: Arial, sans-serif !important;
+ font-size: 14px !important;
+ line-height: 1.5em !important;
+ margin: 0 !important;
+ position: fixed !important;
+ text-align: left !important;
+ right: 20px !important;
+ top: 20px !important;
+ width: 250px !important;
+ z-index: 99999 !important;
}
-#overlay {
- background: #000;
- border-radius: 7px;
- -moz-border-radius: 7px;
- -webkit-border-radius: 7px;
- left: 0;
- height: 100%;
- opacity: .2; filter: alpha(opacity = 20);
- position: absolute;
- top: 0;
- width: 100%;
-}
-
-#apps {
- padding-top: 2px;
- position: absolute;
- width: 100%;
-}
-
- #apps img {
- vertical-align: middle;
+ #wappalyzer-container #wappalyzer-pending {
+ background-repeat: no-repeat !important;
+ background-position: center center !important;
+ height: 60px !important;
}
- #apps a {
- color: #000;
- display: block;
- text-decoration: none;
+ #wappalyzer-container a#wappalyzer-close:link,
+ #wappalyzer-container a#wappalyzer-close:hover,
+ #wappalyzer-container a#wappalyzer-close:active,
+ #wappalyzer-container a#wappalyzer-close:visited {
+ background: #f8f8f8 !important;
+ border-bottom: 1px solid #ddd !important;
+ display: block !important;
+ font-weight: bold !important;
+ line-height: 30px !important;
+ text-align: center !important;
}
- #apps a:hover {
- color: #0072B6;
+ #wappalyzer-container #wappalyzer-close:hover {
+ background: #f4f4f4 !important;
+ color: #0072B6 !important;
}
- #apps .app, #apps #close {
- background: #fff;
- border-radius: 5px;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- margin: 0 2px 2px 2px;
- padding: 7px 10px;
+ #wappalyzer-container #wappalyzer-empty {
+ border-bottom: 1px solid #ddd !important;
+ color: #999 !important;
+ display: block !important;
+ line-height: 30px !important;
+ text-align: center !important;
}
- #apps .application {
- margin-bottom: 3px;
+ #wappalyzer-container #wappalyzer-apps {
+ padding-top: 2px !important;
}
- #apps .category {
- color: #999;
- }
+ #wappalyzer-container #wappalyzer-apps img {
+ vertical-align: middle !important;
+ }
- #apps #close {
- font-size: 12px;
- font-weight: bold;
- text-align: center;
- text-transform: uppercase;
- }
+ #wappalyzer-container #wappalyzer-apps a:link,
+ #wappalyzer-container #wappalyzer-apps a:hover,
+ #wappalyzer-container #wappalyzer-apps a:active,
+ #wappalyzer-container #wappalyzer-apps a:visited {
+ color: #000 !important;
+ display: block !important;
+ text-decoration: none !important;
+ }
- #apps .close:hover {
- background: #f4f4f4;
- color: #000;
- }
+ #wappalyzer-container #wappalyzer-apps a:hover {
+ color: #0072B6 !important;
+ }
+
+ #wappalyzer-container #wappalyzer-apps div.wappalyzer-app {
+ background: #fff !important;
+ border-radius: 5px !important;
+ -moz-border-radius: 5px !important;
+ -webkit-border-radius: 5px !important;
+ margin: 0 2px 2px 2px !important;
+ padding: 7px 10px !important;
+ }
+
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-application:link,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-application:hover,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-application:active,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-application:visited {
+ font-weight: bold !important;
+ margin-bottom: 3px !important;
+ }
+
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:link,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:hover,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:active,
+ #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:visited {
+ color: #999 !important;
+ }
diff --git a/drivers/bookmarklet/index.html b/drivers/bookmarklet/index.html
index 3fcde9640..4c74e5d7d 100644
--- a/drivers/bookmarklet/index.html
+++ b/drivers/bookmarklet/index.html
@@ -1,11 +1,86 @@
+
+
-
+ Wappalyzer
+
+
+
-
+
+ Drag this button to your bookmarks toolbar:
+
+
+
+ Wappalyzer
+
+
+
+ Note: this is a beta version and may stop working at some point. Check back here for a new version if this happens.
+
+
+
+ (function() {
+ var exists = window.document.getElementById('wappalyzer-container');
+
+ if ( exists !== null ) { window.document.body.removeChild(exists); }
+
+ var
+ url = 'http://wappalyzer.com/bookmarklet/',
+ d = window.document,
+ container = d.createElement('div'),
+ pending = d.createElement('div'),
+ style = d.createElement('link'),
+ script1 = d.createElement('script'),
+ script2 = d.createElement('script'),
+ script3 = d.createElement('script')
+ ;
+
+ container.setAttribute('id', 'wappalyzer-container');
+
+ pending .setAttribute('id', 'wappalyzer-pending');
+ pending .setAttribute('style', 'background-image: url(' + url + 'images/pending.gif) !important');
+
+ style.setAttribute('rel', 'stylesheet');
+ style.setAttribute('href', url + 'css/wappalyzer.css');
+
+ script1.setAttribute('src', url + 'js/wappalyzer.js');
+ script2.setAttribute('src', url + 'js/apps.js');
+ script3.setAttribute('src', url + 'js/driver.js');
+
+ d.head.appendChild(style);
+
+ container.appendChild(pending);
+
+ container.appendChild(script1);
+ container.appendChild(script2);
+ container.appendChild(script3);
+
+ d.body.appendChild(container);
+ })();
+
-
+
diff --git a/drivers/bookmarklet/js/driver.js b/drivers/bookmarklet/js/driver.js
index f4c057ef7..8f0c292cb 100644
--- a/drivers/bookmarklet/js/driver.js
+++ b/drivers/bookmarklet/js/driver.js
@@ -1,72 +1,158 @@
+/**
+ * Bookmarklet driver
+ */
+
(function() {
if ( wappalyzer == null ) return;
- var w = wappalyzer;
+ var
+ w = wappalyzer,
+ debug = true
+ d = window.document,
+ container = d.getElementById('wappalyzer-container'),
+ domain = window.top.location.host,
+ url = window.top.location.href,
+ categoryNames = {
+ 1: 'CMS',
+ 2: 'Message Board',
+ 3: 'Database Manager',
+ 4: 'Documentation Tool',
+ 5: 'Widget',
+ 6: 'Web Shop',
+ 7: 'Photo Gallery',
+ 8: 'Wiki',
+ 9: 'Hosting Panel',
+ 10: 'Analytics',
+ 11: 'Blog',
+ 12: 'Javascript Framework',
+ 13: 'Issue Tracker',
+ 14: 'Video Player',
+ 15: 'Comment System',
+ 16: 'Captcha',
+ 17: 'Font Script',
+ 18: 'Web Framework',
+ 19: 'Miscellaneous',
+ 20: 'Editor',
+ 21: 'LMS',
+ 22: 'Web Server',
+ 23: 'Cache Tool',
+ 24: 'Rich Text Editor',
+ 25: 'Javascript Graphics',
+ 26: 'Mobile Framework',
+ 27: 'Programming Language',
+ 28: 'Operating System',
+ 29: 'Search Engine'
+ }
+ ;
w.driver = {
/**
* Log messages to console
*/
log: function(args) {
- if ( console != null ) console[args.type](args.message);
+ if ( debug && console != null && console[args.type] != null ) {
+ console[args.type](args.message);
+ }
},
/**
* Initialize
*/
init: function() {
+ w.driver.getEnvironmentVars();
+ w.driver.getResponseHeaders();
+ },
+
+ getEnvironmentVars: function() {
+ w.log('func: getEnvironmentVars');
+
var env = new Array;
- for ( i in window ) env.push(i);
+ for ( i in window ) { env.push(i); }
- window.document.addEventListener('DOMContentLoaded', function() {
- w.analyze(top.location.host, top.location.href, {
- html: top.document.documentElement.innerHTML,
- env: env
+ w.analyze(domain, url, {
+ html: d.documentElement.innerHTML,
+ env: env
});
- });
+ },
+
+ getResponseHeaders: function() {
+ w.log('func: getResponseHeaders');
+
+ var xhr = new XMLHttpRequest();
+
+ xhr.open('GET', url, true);
+
+ xhr.onreadystatechange = function() {
+ if ( xhr.readyState === 4 && xhr.status ) {
+ var headers = xhr.getAllResponseHeaders().split("\n");
+
+ if ( headers.length > 0 && headers[0] != '' ) {
+ w.log('responseHeaders: ' + xhr.getAllResponseHeaders());
+
+ var responseHeaders = {};
+
+ headers.forEach(function(line) {
+ if ( line ) {
+ name = line.substring(0, line.indexOf(': '));
+ value = line.substring(line.indexOf(': ') + 2, line.length - 1);
+
+ responseHeaders[name] = value;
+ }
+ });
+
+ w.analyze(domain, url, {
+ headers: responseHeaders
+ });
+ }
+ }
+ }
+
+ xhr.send();
},
/**
* Display apps
*/
displayApps: function() {
- var url = top.location.href;
+ var
+ category,
+ html
+ ;
- document.getElementById('wappalyzer-iframe').contentDocument.body.innerHTML =
- '' +
+ html =
+ ' ' +
'Close' +
- ' '
+ '' +
+ ''
;
- if ( w.detected[url] != null && w.detected[url].length ) {
+ if ( false && w.detected[url] != null && w.detected[url].length ) {
w.detected[url].map(function(app, i) {
- var html =
- '
';
- document.getElementById('wappalyzer-iframe').style.height = 300;
+ container.innerHTML = html;
},
/**
diff --git a/drivers/chrome/manifest.json b/drivers/chrome/manifest.json
index 2b4c048fc..44430a255 100644
--- a/drivers/chrome/manifest.json
+++ b/drivers/chrome/manifest.json
@@ -11,7 +11,7 @@
"default_title": "Wappalyzer - click for details",
"default_popup": "popup.html"
},
- "background": {"page": "bg.html"},
+ "background_page": "bg.html",
"content_scripts": [{
"matches": [ "http://*/*", "https://*/*" ],
"js": [ "js/content.js" ],