From 91ea4fe2fbb9d518b34b4fc8c13fc4fea89579c9 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sat, 15 Feb 2014 12:35:29 +1100 Subject: [PATCH] - --- drivers/firefox-sdk/lib/driver.js | 56 ++++++++++++++-------------- drivers/firefox/content/js/driver.js | 3 -- drivers/firefox/install.rdf | 2 +- share/apps.json | 2 +- 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/drivers/firefox-sdk/lib/driver.js b/drivers/firefox-sdk/lib/driver.js index 9271d3126..87964c6b0 100644 --- a/drivers/firefox-sdk/lib/driver.js +++ b/drivers/firefox-sdk/lib/driver.js @@ -27,26 +27,30 @@ initTab; initTab = function(tab) { - var worker = tab.attach({ - contentScriptFile: data.url('js/tab.js') - }); + tabCache[tab.id] = { count: 0, appsDetected: [] }; - worker.port.on('analyze', function(message) { - if ( headersCache[tab.url] !== undefined ) { - message.analyze.headers = headersCache[tab.url]; - } + tab.on('ready', function(tab) { + var worker = tab.attach({ + 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) { - w.log('[ tab.js ] ' + message); + 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'), diff --git a/drivers/firefox/content/js/driver.js b/drivers/firefox/content/js/driver.js index 626b69968..504fd3a8a 100644 --- a/drivers/firefox/content/js/driver.js +++ b/drivers/firefox/content/js/driver.js @@ -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'); } diff --git a/drivers/firefox/install.rdf b/drivers/firefox/install.rdf index ae57f36ec..5f40707f3 100644 --- a/drivers/firefox/install.rdf +++ b/drivers/firefox/install.rdf @@ -3,7 +3,7 @@ wappalyzer@crunchlabz.com - 2.7.7 + 2.7.8 2 true diff --git a/share/apps.json b/share/apps.json index 9a6dc27b5..3858bdad4 100644 --- a/share/apps.json +++ b/share/apps.json @@ -2377,7 +2377,7 @@ "env": "^Shopify$" }, "Shopware": { - "website": "shopware.de", + "website": "shopware.com", "cats": [ 6 ], "meta": { "application-name": "Shopware" }, "script": "shopware\\.js",