Elbert Alias 12 years ago
parent 2efdf4e8af
commit 91ea4fe2fb

@ -27,26 +27,30 @@
initTab; initTab;
initTab = function(tab) { initTab = function(tab) {
var worker = tab.attach({ tabCache[tab.id] = { count: 0, appsDetected: [] };
contentScriptFile: data.url('js/tab.js')
});
worker.port.on('analyze', function(message) { tab.on('ready', function(tab) {
if ( headersCache[tab.url] !== undefined ) { var worker = tab.attach({
message.analyze.headers = headersCache[tab.url]; contentScriptFile: data.url('js/tab.js')
} });
w.analyze(message.hostname, message.url, message.analyze); worker.port.on('analyze', function(message) {
}); var url = message.url.replace(/#.*$/, '');
if ( headersCache[url] !== undefined ) {
message.analyze.headers = headersCache[url];
}
w.analyze(message.hostname, url, message.analyze);
});
worker.port.on('log', function(message) { worker.port.on('log', function(message) {
w.log('[ tab.js ] ' + message); w.log('[ tab.js ] ' + message);
});
}); });
} }
tabs.on('open', function(tab) { tabs.on('open', initTab);
tabCache[tab.id] = { count: 0, appsDetected: [] };
});
tabs.on('close', function(tab) { tabs.on('close', function(tab) {
tabCache[tab.id] = null; tabCache[tab.id] = null;
@ -54,10 +58,6 @@
tabs.on('activate', function(tab) { tabs.on('activate', function(tab) {
w.driver.displayApps(); w.driver.displayApps();
tabs.activeTab.on('ready', function(tab) {
initTab(tab);
});
}); });
panel.port.on('resize', function(height) { panel.port.on('resize', function(height) {
@ -98,8 +98,6 @@
} }
for each ( var tab in tabs ) { for each ( var tab in tabs ) {
tabCache[tab.id] = { count: 0, appsDetected: [] };
initTab(tab); initTab(tab);
} }
@ -119,17 +117,19 @@
}, },
onExamineResponse: function (subject) { onExamineResponse: function (subject) {
var uri = subject.URI.spec.replace(/#.*$/, ''); // Remove hash
if ( headersCache.length > 50 ) { if ( headersCache.length > 50 ) {
headersCache = {}; headersCache = {};
} }
if ( subject.contentType === 'text/html' ) { if ( subject.contentType === 'text/html' ) {
if ( headersCache[subject.URI.spec] === undefined ) { if ( headersCache[uri] === undefined ) {
headersCache[subject.URI.spec] = {}; headersCache[uri] = {};
} }
subject.visitResponseHeaders(function(header, value) { subject.visitResponseHeaders(function(header, value) {
headersCache[subject.URI.spec][header.toLowerCase()] = value; headersCache[uri][header.toLowerCase()] = value;
}); });
} }
} }
@ -145,16 +145,18 @@
}, },
displayApps: function() { displayApps: function() {
var count = w.detected[tabs.activeTab.url] ? Object.keys(w.detected[tabs.activeTab.url]).length.toString() : '0'; var
url = tabs.activeTab.url.replace(/#.*$/, ''),
count = w.detected[url] ? Object.keys(w.detected[url]).length.toString() : '0';
w.log('display apps'); w.log('display apps');
if ( tabCache[tabs.activeTab.id] === undefined ) { if ( tabCache[tabs.activeTab.id] === undefined ) {
tabCache[tabs.activeTab.id] = { count: 0, appsDetected: [] }; initTab(tabs.activeTab);
} }
tabCache[tabs.activeTab.id].count = count; tabCache[tabs.activeTab.id].count = count;
tabCache[tabs.activeTab.id].appsDetected = w.detected[tabs.activeTab.url]; tabCache[tabs.activeTab.id].appsDetected = w.detected[url];
widget.contentURL = data.url('images/icon32.png'); widget.contentURL = data.url('images/icon32.png');
@ -165,7 +167,7 @@
widget.contentURL = data.url('images/icon32_hot.png'), 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[tabs.activeTab.url] ) { for ( appName in w.detected[url] ) {
w.apps[appName].cats.forEach(function(cat) { w.apps[appName].cats.forEach(function(cat) {
if ( cat == match && !found ) { if ( cat == match && !found ) {
widget.contentURL = data.url('images/icons/' + appName + '.png'), widget.contentURL = data.url('images/icons/' + appName + '.png'),

@ -340,9 +340,6 @@
d.getElementById('urlbar-icons').insertBefore(d.getElementById('wappalyzer-container'), d.getElementById('urlbar-icons').childNodes[0]); d.getElementById('urlbar-icons').insertBefore(d.getElementById('wappalyzer-container'), d.getElementById('urlbar-icons').childNodes[0]);
} }
w.log('xxx');
w.log(CustomizableUI.getPlacementOfWidget('wappalyzer-addonbar'));
d.getElementById('wappalyzer-addonbar').setAttribute('collapsed', prefs.getBoolPref('addonBar') ? 'false' : 'true'); d.getElementById('wappalyzer-addonbar').setAttribute('collapsed', prefs.getBoolPref('addonBar') ? 'false' : 'true');
} }

@ -3,7 +3,7 @@
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:id>wappalyzer@crunchlabz.com</em:id> <em:id>wappalyzer@crunchlabz.com</em:id>
<em:version>2.7.7</em:version> <em:version>2.7.8</em:version>
<em:type>2</em:type> <em:type>2</em:type>
<em:unpack>true</em:unpack> <em:unpack>true</em:unpack>

@ -2377,7 +2377,7 @@
"env": "^Shopify$" "env": "^Shopify$"
}, },
"Shopware": { "Shopware": {
"website": "shopware.de", "website": "shopware.com",
"cats": [ 6 ], "cats": [ 6 ],
"meta": { "application-name": "Shopware" }, "meta": { "application-name": "Shopware" },
"script": "shopware\\.js", "script": "shopware\\.js",