|
|
@ -15,26 +15,21 @@
|
|
|
|
ss = require('sdk/simple-storage'),
|
|
|
|
ss = require('sdk/simple-storage'),
|
|
|
|
sp = require("sdk/simple-prefs"),
|
|
|
|
sp = require("sdk/simple-prefs"),
|
|
|
|
tabs = require('sdk/tabs'),
|
|
|
|
tabs = require('sdk/tabs'),
|
|
|
|
panel = require('sdk/panel').Panel({
|
|
|
|
panel,
|
|
|
|
width: 250,
|
|
|
|
widget,
|
|
|
|
height: 50,
|
|
|
|
|
|
|
|
contentURL: data.url('panel.html'),
|
|
|
|
|
|
|
|
contentScriptFile: data.url('js/panel.js'),
|
|
|
|
|
|
|
|
position: { right: 30, top: 30 }
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
widget = require('sdk/widget').Widget({
|
|
|
|
|
|
|
|
id: 'wappalyzer',
|
|
|
|
|
|
|
|
label: 'Wappalyzer',
|
|
|
|
|
|
|
|
contentURL: data.url('images/icon32.png'),
|
|
|
|
|
|
|
|
panel: panel
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
initTab,
|
|
|
|
initTab,
|
|
|
|
addIcon,
|
|
|
|
addIcon,
|
|
|
|
removeIcons;
|
|
|
|
removeIcons,
|
|
|
|
|
|
|
|
createPanel,
|
|
|
|
|
|
|
|
createWidget;
|
|
|
|
|
|
|
|
|
|
|
|
initTab = function(tab) {
|
|
|
|
initTab = function(tab) {
|
|
|
|
tabCache[tab.id] = { count: 0, appsDetected: [] };
|
|
|
|
tabCache[tab.id] = { count: 0, appsDetected: [] };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( !sp.prefs.urlbar ) {
|
|
|
|
|
|
|
|
createWidget();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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')
|
|
|
@ -66,10 +61,6 @@
|
|
|
|
w.driver.displayApps();
|
|
|
|
w.driver.displayApps();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
panel.port.on('resize', function(height) {
|
|
|
|
|
|
|
|
panel.height = height;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addIcon = function(url) {
|
|
|
|
addIcon = function(url) {
|
|
|
|
var
|
|
|
|
var
|
|
|
|
icon = doc.createElement('image'),
|
|
|
|
icon = doc.createElement('image'),
|
|
|
@ -121,6 +112,35 @@
|
|
|
|
} while ( icons.length );
|
|
|
|
} while ( icons.length );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createPanel = function() {
|
|
|
|
|
|
|
|
if ( panel ) {
|
|
|
|
|
|
|
|
panel.destroy();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel = require('sdk/panel').Panel({
|
|
|
|
|
|
|
|
width: 250,
|
|
|
|
|
|
|
|
height: 50,
|
|
|
|
|
|
|
|
contentURL: data.url('panel.html'),
|
|
|
|
|
|
|
|
contentScriptFile: data.url('js/panel.js'),
|
|
|
|
|
|
|
|
position: { right: 30, top: 30 }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panel.port.on('resize', function(height) {
|
|
|
|
|
|
|
|
panel.height = height;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createWidget = function() {
|
|
|
|
|
|
|
|
createPanel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widget = require('sdk/widget').Widget({
|
|
|
|
|
|
|
|
id: 'wappalyzer',
|
|
|
|
|
|
|
|
label: 'Wappalyzer',
|
|
|
|
|
|
|
|
contentURL: data.url('images/icon32.png'),
|
|
|
|
|
|
|
|
panel: panel
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
w.driver = {
|
|
|
|
w.driver = {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Log messages to console
|
|
|
|
* Log messages to console
|
|
|
@ -135,6 +155,12 @@
|
|
|
|
init: function(callback) {
|
|
|
|
init: function(callback) {
|
|
|
|
var json = JSON.parse(data.load('apps.json'));
|
|
|
|
var json = JSON.parse(data.load('apps.json'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( sp.prefs.urlbar ) {
|
|
|
|
|
|
|
|
createPanel();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
createWidget();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
var version = require('sdk/self').version;
|
|
|
|
var version = require('sdk/self').version;
|
|
|
|
|
|
|
|
|
|
|
@ -161,6 +187,14 @@
|
|
|
|
sp.on('urlbar', function() {
|
|
|
|
sp.on('urlbar', function() {
|
|
|
|
if ( !sp.prefs.urlbar ) {
|
|
|
|
if ( !sp.prefs.urlbar ) {
|
|
|
|
removeIcons();
|
|
|
|
removeIcons();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createWidget();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
widget.destroy();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createPanel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w.driver.displayApps();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -215,6 +249,7 @@
|
|
|
|
w.log('display apps');
|
|
|
|
w.log('display apps');
|
|
|
|
|
|
|
|
|
|
|
|
if ( tabCache[tabs.activeTab.id] === undefined ) {
|
|
|
|
if ( tabCache[tabs.activeTab.id] === undefined ) {
|
|
|
|
|
|
|
|
console.log(tabs);
|
|
|
|
initTab(tabs.activeTab);
|
|
|
|
initTab(tabs.activeTab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -234,13 +269,13 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
widget.contentURL = data.url('images/icon32.png');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( count > 0 ) {
|
|
|
|
if ( count > 0 ) {
|
|
|
|
// Find the main application to display
|
|
|
|
// Find the main application to display
|
|
|
|
var i, appName, found = false;
|
|
|
|
var i, appName, found = false;
|
|
|
|
|
|
|
|
|
|
|
|
widget.contentURL = data.url('images/icon32_hot.png'),
|
|
|
|
if ( !sp.prefs.urlbar ) {
|
|
|
|
|
|
|
|
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] ) {
|
|
|
|