You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
11 years ago
|
(function() {
|
||
|
self.port.on('displayApps', function(message) {
|
||
|
var detectedApps = document.getElementById('detected-apps');
|
||
|
|
||
|
detectedApps.innerHTML = '';
|
||
|
|
||
|
if ( message.tabCache.count > 0 ) {
|
||
|
for ( appName in message.tabCache.appsDetected ) {
|
||
|
confidence = message.tabCache.appsDetected[appName].confidenceTotal;
|
||
|
version = message.tabCache.appsDetected[appName].version;
|
||
|
|
||
|
html =
|
||
|
'<div class="detected-app">' +
|
||
|
'<a target="_blank" href="https://wappalyzer.com/applications/' + appName.toLowerCase().replace(/ /g, '-').replace(/[^\w-]/g, '') + '?utm_source=firefox&utm_medium=panel&utm_campaign=extensions">' +
|
||
|
'<img src="images/icons/' + appName + '.png"/>' +
|
||
|
'<span class="label">' + appName + ( version ? ' ' + version : '' ) + ( confidence < 100 ? ' (' + confidence + '% sure)' : '' ) + '</span>' +
|
||
|
'</a>';
|
||
|
|
||
|
message.apps[appName].cats.forEach(function(cat) {
|
||
|
html +=
|
||
|
'<a target="_blank" href="https://wappalyzer.com/categories/' + message.categories[cat] + '?utm_source=firefox&utm_medium=panel&utm_campaign=extensions">' +
|
||
|
'<span class="category">' + message.categoryNames[cat] + '</span>' +
|
||
|
'</a>';
|
||
|
});
|
||
|
|
||
|
html +=
|
||
|
'</a>' +
|
||
|
'</div>';
|
||
|
|
||
|
detectedApps.innerHTML = detectedApps.innerHTML + html;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
self.port.emit('resize', document.body.offsetHeight);
|
||
|
});
|
||
|
}());
|