diff --git a/drivers/bookmarklet/css/wappalyzer.css b/drivers/bookmarklet/css/wappalyzer.css index fe86b5fdf..67836659c 100644 --- a/drivers/bookmarklet/css/wappalyzer.css +++ b/drivers/bookmarklet/css/wappalyzer.css @@ -1,6 +1,10 @@ div#wappalyzer-container * { background-color: transparent !important; border: none !important; + border-left: none !important; + border-top: none !important; + border-right: none !important; + border-bottom: none !important; border-spacing: 0 !important; color: inherit !important; font-size: inherit !important; @@ -21,7 +25,7 @@ div#wappalyzer-container * { background: #fff !important; border: 1px solid #999; box-shadow: 0 0 10px rgba(0, 0, 0, .2) !important; - color: #333 !important; + color: #222 !important; font-family: Arial, sans-serif !important; font-size: 14px !important; line-height: 1.5em !important; @@ -45,7 +49,7 @@ div#wappalyzer-container * { #wappalyzer-container a#wappalyzer-close:active, #wappalyzer-container a#wappalyzer-close:visited { background: #f8f8f8 !important; - border-bottom: 1px solid #ddd !important; + border-bottom: 1px solid #ccc !important; display: block !important; font-weight: bold !important; line-height: 30px !important; @@ -58,7 +62,7 @@ div#wappalyzer-container * { } #wappalyzer-container #wappalyzer-empty { - border-bottom: 1px solid #ddd !important; + border-bottom: 1px solid #ccc !important; color: #999 !important; display: block !important; line-height: 30px !important; @@ -77,7 +81,6 @@ div#wappalyzer-container * { #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; } @@ -109,3 +112,7 @@ div#wappalyzer-container * { #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:visited { color: #999 !important; } + + #wappalyzer-container #wappalyzer-apps a.wappalyzer-category:hover { + color: #0072B6 !important; + } diff --git a/drivers/bookmarklet/images/pending.gif b/drivers/bookmarklet/images/pending.gif new file mode 100644 index 000000000..3864c0797 Binary files /dev/null and b/drivers/bookmarklet/images/pending.gif differ diff --git a/drivers/chrome/.gitignore b/drivers/chrome/.gitignore new file mode 100644 index 000000000..a21be109e --- /dev/null +++ b/drivers/chrome/.gitignore @@ -0,0 +1 @@ +chrome.zip diff --git a/drivers/chrome/bg.html b/drivers/chrome/background.html similarity index 88% rename from drivers/chrome/bg.html rename to drivers/chrome/background.html index c91b915aa..e48930bc6 100644 --- a/drivers/chrome/bg.html +++ b/drivers/chrome/background.html @@ -5,6 +5,7 @@ <script src="js/wappalyzer.js"></script> <script src="js/apps.js"></script> <script src="js/driver.js"></script> + <script src="js/ga.js"></script> </head> <body> <script> diff --git a/drivers/chrome/js/background.js b/drivers/chrome/js/background.js new file mode 100644 index 000000000..e354989a4 --- /dev/null +++ b/drivers/chrome/js/background.js @@ -0,0 +1,3 @@ +wappalyzer.log('bg.html'); + +wappalyzer.init(); diff --git a/drivers/chrome/js/driver.js b/drivers/chrome/js/driver.js index f6a1db106..d792b1ae6 100644 --- a/drivers/chrome/js/driver.js +++ b/drivers/chrome/js/driver.js @@ -61,7 +61,7 @@ chrome.tabs.getAllInWindow(null, function(tabs) { tabs.map(function(tab) { - if ( tab.url.match(/https?:\/\//) ) { + if ( tab.url.match(/^https?:\/\//) ) { chrome.tabs.executeScript(tab.id, { file: 'js/content.js' }); } }) @@ -92,9 +92,56 @@ tabCache[tab.id].appsDetected = w.detected[tab.url]; if ( count > 0 ) { + // Find the main application to display + var found = false; + + w.driver.categoryOrder.map(function(match) { + w.detected[tab.url].map(function(appName) { + w.apps[appName].cats.map(function(cat) { + if ( cat === match && !found ) { + chrome.browserAction.setIcon({ tabId: tab.id, path: 'images/icons/' + appName + '.png' }); + + found = true; + } + }); + }); + }); + chrome.browserAction.setBadgeText({ tabId: tab.id, text: count }); - } + }; }, + + categoryOrder: [ // Used to pick the main application + 1, // CMS + 11, // Blog + 6, // Web Shop + 2, // Message Board + 8, // Wiki + 13, // Issue Tracker + 18, // Web Framework + 21, // LMS + 7, // Photo Gallery + 3, // Database Manager + 4, // Documentation Tool + 9, // Hosting Panel + 29, // Search Engine + 12, // Javascript Framework + 26, // Mobile Framework + 25, // Javascript Graphics + 22, // Web Server + 27, // Programming Language + 28, // Operating System + 15, // Comment System + 20, // Editor + 10, // Analytics + 17, // Font Script + 23, // Cache Tool + 24, // Rich Text Editor + 5, // Widget + 14, // Video Player + 16, // Captcha + 19 // Miscellaneous + ] }; w.init(); diff --git a/drivers/chrome/js/ga.js b/drivers/chrome/js/ga.js new file mode 100644 index 000000000..e0f08651e --- /dev/null +++ b/drivers/chrome/js/ga.js @@ -0,0 +1,19 @@ +(function() { + // Google Analytics + var _gaq = _gaq || []; + + _gaq.push(['_setAccount', 'UA-216336-23']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); + + ga.type = 'text/javascript'; + ga.async = true; + ga.src = 'https://ssl.google-analytics.com/ga.js'; + + var s = document.getElementsByTagName('script')[0]; + + s.parentNode.insertBefore(ga, s); + })(); +})(); diff --git a/drivers/chrome/js/popup.js b/drivers/chrome/js/popup.js new file mode 100644 index 000000000..dbb772200 --- /dev/null +++ b/drivers/chrome/js/popup.js @@ -0,0 +1,69 @@ +var wappalyzer = {}; + +(function() { + var popup = { + pollHeaders: null, + + init: function() { + chrome.tabs.getSelected(null, function(tab) { + if ( tab.url.match(/https?:\/\//) ) { + $('#detected-apps').html('<div class="empty">No applications detected.</div>'); + + $('#analyze-headers').show().click(function() { + $(this).addClass('pending'); + + chrome.extension.sendRequest({ id: 'fetch_headers', tab: tab }); + + popup.pollHeaders = setInterval(popup.displayApps, 100); + }); + } else { + $('#detected-apps').html('<div class="empty">Nothing to do here.</div>'); + + $('#analyze-headers').hide(); + } + }); + + popup.displayApps(); + }, + + displayApps: function() { + chrome.tabs.getSelected(null, function(tab) { + chrome.extension.sendRequest({ id: 'get_apps', tab: tab }, function(response) { + if ( response.tabCache.analyzed.indexOf('headers') > 0 ) { + clearTimeout(popup.pollHeaders); + + $('#analyze-headers').removeClass('pending'); + } + + if ( response.tabCache.count > 0 ) { + $('#detected-apps').html(''); + + response.tabCache.appsDetected.map(function(appName) { + html = + '<div class="detected-app">' + + '<a target="_blank" href="http://wappalyzer.com/applications/' + encodeURIComponent(appName) + '">' + + '<img src="images/icons/' + appName + '.png"/>' + + '<span class="label">' + appName + '</span>' + + '</a>'; + + wappalyzer.apps[appName].cats.map(function(cat) { + html += + '<a target="_blank" href="http://wappalyzer.com/categories/' + wappalyzer.categories[cat] + '">' + + '<span class="category">' + categoryNames[cat] + '</span>' + + '</a>'; + }); + + html += + '</a>' + + '</div>'; + + $('#detected-apps').append(html); + }); + } + }); + }); + } + } + + popup.init(); +})(); diff --git a/drivers/chrome/manifest.json b/drivers/chrome/manifest.json index 44430a255..8f4574545 100644 --- a/drivers/chrome/manifest.json +++ b/drivers/chrome/manifest.json @@ -4,18 +4,20 @@ "32": "images/icon_32.png", "128": "images/icon_128.png" }, - "version": "0.9", + "version": "2", "description": "Identifies software on the web", + "homepage_url": "http://wappalyzer.com", "browser_action": { "default_icon": "images/icon_32.png", "default_title": "Wappalyzer - click for details", "default_popup": "popup.html" }, - "background_page": "bg.html", + "background": { "page": "background.html" }, "content_scripts": [{ "matches": [ "http://*/*", "https://*/*" ], "js": [ "js/content.js" ], "run_at": "document_idle" }], - "permissions": [ "tabs", "http://*/*", "https://*/*" ] + "permissions": [ "tabs", "http://*/*", "https://*/*" ], + "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'" } diff --git a/drivers/chrome/popup.html b/drivers/chrome/popup.html index 6f57eff5a..1cceee3c6 100644 --- a/drivers/chrome/popup.html +++ b/drivers/chrome/popup.html @@ -4,87 +4,15 @@ <head> <link rel="stylesheet" href="popup.css"> - <script> - var wappalyzer = {}; - </script> - <script src="js/lib/jquery.min.js"></script> + <script src="js/popup.js"></script> <script src="js/apps.js"></script> <script src="js/locale.js"></script> + <script src="js/ga.js"></script> </head> <body> <div id="detected-apps"></div> <div id="analyze-headers">Analyze headers</div> - - <script> - (function() { - var popup = { - pollHeaders: null, - - init: function() { - chrome.tabs.getSelected(null, function(tab) { - if ( tab.url.match(/https?:\/\//) ) { - $('#detected-apps').html('<div class="empty">No applications detected.</div>'); - - $('#analyze-headers').show().click(function() { - $(this).addClass('pending'); - - chrome.extension.sendRequest({ id: 'fetch_headers', tab: tab }); - - popup.pollHeaders = setInterval(popup.displayApps, 100); - }); - } else { - $('#detected-apps').html('<div class="empty">Nothing to do here.</div>'); - - $('#analyze-headers').hide(); - } - }); - - popup.displayApps(); - }, - - displayApps: function() { - chrome.tabs.getSelected(null, function(tab) { - chrome.extension.sendRequest({ id: 'get_apps', tab: tab }, function(response) { - if ( response.tabCache.analyzed.indexOf('headers') > 0 ) { - clearTimeout(popup.pollHeaders); - - $('#analyze-headers').removeClass('pending'); - } - - if ( response.tabCache.count > 0 ) { - $('#detected-apps').html(''); - - response.tabCache.appsDetected.map(function(appName) { - html = - '<div class="detected-app">' + - '<a target="_blank" href="http://wappalyzer.com/applications/' + encodeURIComponent(appName) + '">' + - '<img src="images/icons/' + appName + '.png"/>' + - '<span class="label">' + appName + '</span>' + - '</a>'; - - wappalyzer.apps[appName].cats.map(function(cat) { - html += - '<a target="_blank" href="http://wappalyzer.com/categories/' + wappalyzer.categories[cat] + '">' + - '<span class="category">' + categoryNames[cat] + '</span>' + - '</a>'; - }); - - html += - '</a>' + - '</div>'; - - $('#detected-apps').append(html); - }); - } - }); - }); - } - } - - popup.init(); - })(); - </script> </body> </html> diff --git a/drivers/firefox/.gitignore b/drivers/firefox/.gitignore new file mode 100644 index 000000000..3a203c535 --- /dev/null +++ b/drivers/firefox/.gitignore @@ -0,0 +1 @@ +wappalyzer.xpi