Upgraded manifest to 2.0, display main app icon

main
ElbertF 13 years ago
parent 563d5e9539
commit 7ef570d08d

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

@ -0,0 +1 @@
chrome.zip

@ -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>

@ -0,0 +1,3 @@
wappalyzer.log('bg.html');
wappalyzer.init();

@ -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 ) {
chrome.browserAction.setBadgeText({ tabId: tab.id, text: count });
// 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();

@ -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);
})();
})();

@ -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();
})();

@ -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'"
}

@ -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>

@ -0,0 +1 @@
wappalyzer.xpi