Elbert Alias 11 years ago
parent 2efdf4e8af
commit 91ea4fe2fb

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

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