|
|
@ -26,12 +26,6 @@
|
|
|
|
initTab = function(tab) {
|
|
|
|
initTab = function(tab) {
|
|
|
|
tabCache[tab.id] = { count: 0, appsDetected: [] };
|
|
|
|
tabCache[tab.id] = { count: 0, appsDetected: [] };
|
|
|
|
|
|
|
|
|
|
|
|
if ( !sp.prefs.urlbar ) {
|
|
|
|
|
|
|
|
createWidget();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w.driver.displayApps();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tab.on('ready', function(tab) {
|
|
|
|
tab.on('ready', function(tab) {
|
|
|
|
var worker = tab.attach({
|
|
|
|
var worker = tab.attach({
|
|
|
|
contentScriptFile: data.url('js/tab.js')
|
|
|
|
contentScriptFile: data.url('js/tab.js')
|
|
|
@ -63,14 +57,18 @@
|
|
|
|
w.driver.displayApps();
|
|
|
|
w.driver.displayApps();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
addIcon = function(url) {
|
|
|
|
addIcon = function(appName) {
|
|
|
|
var icon = getDocument().createElement('image');
|
|
|
|
var
|
|
|
|
|
|
|
|
icon = getDocument().createElement('image'),
|
|
|
|
|
|
|
|
url = appName !== undefined ? 'images/icons/' + appName + '.png' : 'images/icon32.png',
|
|
|
|
|
|
|
|
tooltipText = ( appName !== undefined ? appName + ' - ' + require('sdk/l10n').get('clickForDetails') + ' - ' : '' ) + require('sdk/l10n').get('name');
|
|
|
|
|
|
|
|
|
|
|
|
icon.setAttribute('src', data.url(url));
|
|
|
|
icon.setAttribute('src', data.url(url));
|
|
|
|
icon.setAttribute('class', 'wappalyzer-icon');
|
|
|
|
icon.setAttribute('class', 'wappalyzer-icon');
|
|
|
|
icon.setAttribute('width', '16');
|
|
|
|
icon.setAttribute('width', '16');
|
|
|
|
icon.setAttribute('height', '16');
|
|
|
|
icon.setAttribute('height', '16');
|
|
|
|
icon.setAttribute('style', 'margin: 0 1px;');
|
|
|
|
icon.setAttribute('style', 'margin: 0 1px;');
|
|
|
|
|
|
|
|
icon.setAttribute('tooltiptext', tooltipText);
|
|
|
|
|
|
|
|
|
|
|
|
getUrlBar().appendChild(icon);
|
|
|
|
getUrlBar().appendChild(icon);
|
|
|
|
|
|
|
|
|
|
|
@ -282,19 +280,20 @@
|
|
|
|
// Add icons
|
|
|
|
// Add icons
|
|
|
|
if ( count ) {
|
|
|
|
if ( count ) {
|
|
|
|
for ( appName in tabCache[tabs.activeTab.id].appsDetected ) {
|
|
|
|
for ( appName in tabCache[tabs.activeTab.id].appsDetected ) {
|
|
|
|
addIcon('images/icons/' + appName + '.png');
|
|
|
|
addIcon(appName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
addIcon('images/icon32.png');
|
|
|
|
addIcon();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ( count ) {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
widget.contentURL = data.url('images/icon32_hot.png');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( count ) {
|
|
|
|
// Find the main application to display
|
|
|
|
// Find the main application to display
|
|
|
|
var
|
|
|
|
var
|
|
|
|
appName,
|
|
|
|
appName,
|
|
|
|
found = false;
|
|
|
|
found = false;
|
|
|
|
|
|
|
|
|
|
|
|
widget.contentURL = data.url('images/icon32_hot.png');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w.driver.categoryOrder.forEach(function(match) {
|
|
|
|
w.driver.categoryOrder.forEach(function(match) {
|
|
|
|
for ( appName in w.detected[url] ) {
|
|
|
|
for ( appName in w.detected[url] ) {
|
|
|
|
w.apps[appName].cats.forEach(function(cat) {
|
|
|
|
w.apps[appName].cats.forEach(function(cat) {
|
|
|
@ -307,6 +306,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
panel.port.emit('displayApps', { tabCache: tabCache[tabs.activeTab.id], apps: w.apps, categories: w.categories, categoryNames: categoryNames });
|
|
|
|
panel.port.emit('displayApps', { tabCache: tabCache[tabs.activeTab.id], apps: w.apps, categories: w.categories, categoryNames: categoryNames });
|
|
|
|
},
|
|
|
|
},
|
|
|
|