Added URL bar icons

main
Elbert Alias 11 years ago
parent ba84702b6f
commit feb08b5186

@ -5,6 +5,9 @@
{Cc, Ci} = require('chrome'),
main = require('wappalyzer'),
w = main.wappalyzer,
mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator),
doc = mediator.getMostRecentWindow('navigator:browser').document,
urlBar = doc.getElementById('urlbar-icons'),
tabCache = {},
headersCache = {},
categoryNames = {},
@ -16,7 +19,8 @@
width: 250,
height: 50,
contentURL: data.url('panel.html'),
contentScriptFile: data.url('js/panel.js')
contentScriptFile: data.url('js/panel.js'),
position: { right: 30, top: 30 }
}),
widget = require('sdk/widget').Widget({
id: 'wappalyzer',
@ -24,7 +28,9 @@
contentURL: data.url('images/icon32.png'),
panel: panel
}),
initTab;
initTab,
addIcon,
removeIcons;
initTab = function(tab) {
tabCache[tab.id] = { count: 0, appsDetected: [] };
@ -48,7 +54,7 @@
w.log('[ tab.js ] ' + message);
});
});
}
};
tabs.on('open', initTab);
@ -64,6 +70,57 @@
panel.height = height;
});
addIcon = function(url) {
var
icon = doc.createElement('image'),
show = true;
icon.setAttribute('src', data.url(url));
icon.setAttribute('class', 'wappalyzer-icon');
icon.setAttribute('width', '16');
icon.setAttribute('height', '16');
icon.setAttribute('style', 'cursor: pointer; margin-right: 2px;');
icon.addEventListener('mouseover', function() {
if ( panel.isShowing ) {
show = false;
}
});
icon.addEventListener('mouseout', function() {
show = true;
});
icon.addEventListener('click', function() {
if ( show ) {
panel.show();
show = false;
} else {
panel.hide();
show = true;
}
}, false);
urlBar.appendChild(icon);
return icon;
};
removeIcons = function() {
var icons;
do {
icons = urlBar.getElementsByClassName('wappalyzer-icon');
if ( icons.length ) {
urlBar.removeChild(icons[0]);
}
} while ( icons.length );
};
w.driver = {
/**
* Log messages to console
@ -101,6 +158,13 @@
initTab(tab);
}
sp.on('urlbar', function() {
console.log('x');
if ( !sp.prefs.urlbar ) {
removeIcons();
}
});
var httpRequestObserver = {
init: function() {
var observerService = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
@ -146,8 +210,8 @@
displayApps: function() {
var
url = tabs.activeTab.url.replace(/#.*$/, ''),
count = w.detected[url] ? Object.keys(w.detected[url]).length.toString() : '0';
url = tabs.activeTab.url.replace(/#.*$/, ''),
count = w.detected[url] ? Object.keys(w.detected[url]).length : 0;
w.log('display apps');
@ -158,6 +222,19 @@
tabCache[tabs.activeTab.id].count = count;
tabCache[tabs.activeTab.id].appsDetected = w.detected[url];
if ( sp.prefs.urlbar ) {
removeIcons();
// Add icons
if ( count ) {
for ( appName in tabCache[tabs.activeTab.id].appsDetected ) {
addIcon('images/icons/' + appName + '.png');
}
} else {
addIcon('images/icon32.png');
}
}
widget.contentURL = data.url('images/icon32.png');
if ( count > 0 ) {

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = Keine Applikationen erkannt
addonBar = Wappalyzer has been placed in the add-on bar.\n\nTo show the add-on bar, close this window and press Ctrl+/.
help = Wappalyzer - klicken für Details und Einstellungen
showIcons = Applikations-Icons zeigen
preferences = Weitere Optionen ...
addonBar = In Addon-Leiste platzieren (Ctrl+/ oder Cmd+/)
categories = Kategorienverwaltung
performance = Performance
interface = Interface
tracking_title = Tracken
tracking_description = Sende anonyme Reports über gefundene Applikationen zu Forschungszwecken an wappalyzer.com
analyzeHeaders = Analyze response headers
analyzeJavaScript = Analyze JavaScript
analyzeOnload = Analyze onLoad events
urlbar_title = Display icons in URL bar
feedback = Feedback
github = Github

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = No applications detected
addonBar = Wappalyzer has been placed in the add-on bar.\n\nTo show the add-on bar, close this window and press Ctrl+/.
help = Wappalyzer - Click for more detail and settings
showIcons = Show application icons
preferences = Options
addonBar = Place in addon-bar (press Ctrl+/ or Cmd+/ to toggle)
categories = Categories
performance = Performance
interface = Interface
tracking_title = Tracking
tracking_description = Anonymously send reports on detected applications to wappalyzer.com for analysis
analyzeHeaders = Analyze response headers
analyzeJavaScript = Analyze JavaScript
analyzeOnload = Analyze onLoad events
urlbar_title = Display icons in URL bar
feedback = Feedback
github = Github

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = No applications detected
addonBar = Wappalyzer has been placed in the add-on bar.\n\nTo show the add-on bar, close this window and press Ctrl+/.
help = Wappalyzer - Click for more detail and settings
showIcons = Show application icons
preferences = Options
addonBar = Place in addon-bar (press Ctrl+/ or Cmd+/ to toggle)
categories = Categories
performance = Performance
interface = Interface
tracking_title = Tracking
research_description = Anonymously send reports on detected applications to wappalyzer.com for analysis
analyzeHeaders = Analyze response headers
analyzeJavaScript = Analyze JavaScript
analyzeOnload = Analyze onLoad events
urlbar_title = Display icons in URL bar
feedback = Feedback
github = Github

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = Aplicaciones no detectadas
addonBar = Wappalyzer se ha colocado en la barra de complementos.\n\nPara mostrar la barra de complementos, cierra esta ventana y pulsa Ctrl+/.
help = Wappalyzer - Clic para mas detalles y configuración
showIcons = Mostrar iconos de aplicaciones
preferences = Opciones
addonBar = Colocar en barra de complementos (pulsa Ctrl+/ o Cmd+/ para alternar)
categories = Categorías
performance = Rendimiento
interface = Interfaz
tracking_title = Seguimiento
tracking_description = Enviar informes anónimos sobre las aplicaciones detectadas a wappalyzer.com para análisis
analyzeHeaders = Analizar cabeceras de respuesta
analyzeJavaScript = Analizar JavaScript
analyzeOnload = Analizar eventos onLoad
urlbar_title = Display icons in URL bar
feedback = Opinión
github = Github

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = Pas d'applications détectées
addonBar = Wappalyzer a été placé dans la barre des modules.\n\n Pour voir la barre des modules pressez Ctrl+/ ou Cmd+/.
help = Wappalyzer - Cliquer pour plus de détails et options
showIcons = Montrer les icônes des applications
preferences = Plus d'options...
addonBar = Placer dans la barre des modules (Ctrl+/)
categories = Gérer les catégories
performance = Performance
interface = Interface
tracking_title = Traçage
tracking_description = Envoyer anonymement des rapports sur les applications détectées à wappalyzer.com pour la recherche
analyzeHeaders = Analyser les headers
analyzeJavaScript = Analyser le JavaScript
analyzeOnload = Analyser les évènements au chargement
urlbar_title = Display icons in URL bar
feedback = Donner votre avis
github = Github

@ -1,19 +1,11 @@
name = Wappalyzer
noAppsDetected = Geen applications gedetecteerd
addonBar = Wappalyzer is in de add-on balk geplaatst. Om de add-on te laten zien, sluit dit bericht en druk Ctrl+/.
help = Wappalyzer - Klik voor meer informatie
showIcons = Iconen zichtbaar
preferences = Meer opties...
addonBar = Plaats in addon-bar (klik Ctrl+/ of Cmd+/)
categories = Beheer categorien
performance = Performance
interface = Interface
tracking_title = Tracking
tracking_description = Verzend anonieme informatie over applicaties naar wappalyzer.com voor onderzoek
analyzeHeaders = Analiseer response headers
analyzeJavaScript = Analiseer JavaScript
analyzeOnload = Analiseer onLoad events
urlbar_title = Display icons in URL bar
feedback = Feedback
github = Github

@ -15,5 +15,10 @@
"description": "Anonymously send reports on detected applications to wappalyzer.com for analysis",
"type": "bool",
"value": true
}, {
"name": "urlbar",
"title": "Display icons in URL bar",
"type": "bool",
"value": true
}]
}

@ -1,12 +0,0 @@
var main = require("./main");
exports["test main"] = function(assert) {
assert.pass("Unit test running!");
};
exports["test main async"] = function(assert, done) {
assert.pass("async Unit test running!");
done();
};
require("sdk/test").run(exports);
Loading…
Cancel
Save