diff --git a/drivers/chrome/js/driver.js b/drivers/chrome/js/driver.js index 668489833..2c67b5c41 100644 --- a/drivers/chrome/js/driver.js +++ b/drivers/chrome/js/driver.js @@ -96,7 +96,7 @@ }, goToURL: function(args) { - window.open(args.url); + window.open(args.url + '?utm_source=firefox&utm_medium=extension&utm_campaign=extensions'); }, /** diff --git a/drivers/firefox/content/js/content.js b/drivers/firefox/content/js/content.js index 7f8bc44dc..60927bb97 100644 --- a/drivers/firefox/content/js/content.js +++ b/drivers/firefox/content/js/content.js @@ -1,28 +1,40 @@ "use strict"; (function() { - var lastEnv = null; + var + lastEnv = null, + prefs = {} + ; addEventListener('DOMContentLoaded', function() { removeEventListener('DOMContentLoaded', onLoad, false); + prefs = sendSyncMessage('wappalyzer', { action: 'get prefs' })[0]; + onLoad(); }, false); function onLoad() { if ( content.document.contentType != 'text/html' ) { return; } - content.document.documentElement.addEventListener('load', function() { - var env = Object.keys(content.wrappedJSObject); + if ( prefs.analyzeOnLoad ) { + content.document.documentElement.addEventListener('load', function() { + var env = Object.keys(content.wrappedJSObject); - if ( env.join() !== lastEnv ) { - lastEnv = env.join(); + if ( env.join() !== lastEnv ) { + lastEnv = env.join(); - sendAsyncMessage('wappalyzer', { env: Object.keys(content.wrappedJSObject) }); - } + sendAsyncMessage('wappalyzer', { + action: 'analyze', + analyze: { + env: Object.keys(content.wrappedJSObject) + } + }); + } - removeEventListener('load', onLoad, true); - }, true); + removeEventListener('load', onLoad, true); + }, true); + } // HTML var html = content.document.documentElement.outerHTML; @@ -37,9 +49,13 @@ } sendAsyncMessage('wappalyzer', { + action: 'analyze', hostname: content.location.hostname, - html: html, - url: content.location.href + url: content.location.href, + analyze: { + html: html, + env: prefs.analyzeJavaScript ? Object.keys(content.wrappedJSObject) : [] + } }); } })(); diff --git a/drivers/firefox/content/js/driver.js b/drivers/firefox/content/js/driver.js index 7df97e7cd..d67d232c9 100644 --- a/drivers/firefox/content/js/driver.js +++ b/drivers/firefox/content/js/driver.js @@ -39,13 +39,13 @@ AddonManager.getAddonByID('wappalyzer@crunchlabz.com', function(addon) { // Load jQuery - (function () { - Cc['@mozilla.org/moz/jssubscript-loader;1'].getService(Ci.mozIJSSubScriptLoader).loadSubScript('chrome://wappalyzer/content/js/lib/jquery.min.js'); - })(); + Cc['@mozilla.org/moz/jssubscript-loader;1'].getService(Ci.mozIJSSubScriptLoader).loadSubScript('chrome://wappalyzer/content/js/lib/jquery.min.js'); // Preferences prefs = Cc['@mozilla.org/preferences-service;1'].getService(Ci.nsIPrefService).getBranch('extensions.wappalyzer.'); + prefs.addObserver('', w.driver, false); + container(); bindings(); @@ -75,6 +75,8 @@ // Get response headers onStateChange: function(progress, request, flags, status) { + if ( !prefs.getBoolPref('analyzeHeaders') ) { return; } + if ( request != null && flags & Ci.nsIWebProgressListener.STATE_STOP ) { if ( request.nsIHttpChannel && request.contentType == 'text/html' ) { if ( progress.currentURI && request.name == progress.currentURI.spec ) { @@ -101,6 +103,20 @@ window.addEventListener('unload', w.driver.track, false); }, + // Observe preference changes + observe: function(subject, topic, data) { + if ( topic != 'nsPref:changed' ) { return; } + + switch(data) { + case 'addonBar': + container(); + + break; + } + + w.driver.displayApps(); + }, + /** * Display apps */ @@ -203,7 +219,7 @@ * Go to URL */ goToURL: function(args) { - gBrowser.selectedTab = gBrowser.addTab(args.url); + gBrowser.selectedTab = gBrowser.addTab(args.url + '?utm_source=firefox&utm_medium=extension&utm_campaign=extensions'); }, /** @@ -237,7 +253,19 @@ function content(msg) { w.log('content.js'); - w.analyze(msg.json.hostname, msg.json.url, { html: msg.json.html, env: msg.json.env }); + switch ( msg.json.action ) { + case 'analyze': + w.analyze(msg.json.hostname, msg.json.url, msg.json.analyze); + + break; + case 'get prefs': + return { + analyzeJavaScript: prefs.getBoolPref('analyzeJavaScript'), + analyzeOnLoad: prefs.getBoolPref('analyzeOnLoad') + }; + + break; + } msg = null; } @@ -249,11 +277,11 @@ if ( prefs.getBoolPref('addonBar') ) { $('#wappalyzer-container').prependTo($('#wappalyzer-addonbar')); - $('#wappalyzer-addonbar').show(); + $('#wappalyzer-addonbar').attr('collapsed', 'false'); } else { $('#wappalyzer-container').prependTo($('#urlbar-icons')); - $('#wappalyzer-addonbar').hide(); + $('#wappalyzer-addonbar').attr('collapsed', 'true'); } } @@ -264,35 +292,11 @@ // Menu items var prefix = '#wappalyzer-menu-'; - $(prefix + 'icons') - .attr('checked', prefs.getBoolPref('showIcons') ? 'true' : 'false') - .bind('command', function() { - prefs.setBoolPref('showIcons', !prefs.getBoolPref('showIcons')); - - $(this).attr('checked', prefs.getBoolPref('showIcons') ? 'true' : 'false'); - - w.driver.displayApps(); - }); - $(prefix + 'preferences' ) .bind('command', function() { w.driver.goToURL({ url: 'chrome://wappalyzer/content/xul/preferences.xul' }) }); - $(prefix + 'addonbar' ) - .attr('checked', prefs.getBoolPref('addonBar') ? 'true' : 'false') - .bind('command', function() { - prefs.setBoolPref('addonBar', !prefs.getBoolPref('addonBar')); - - $(this).attr('checked', prefs.getBoolPref('addonBar') ? 'true' : 'false'); - - container(); - - if ( prefs.getBoolPref('addonBar') ) { - alert(strings.getString('wappalyzer.addonBar')); - } - }); - $(prefix + 'feedback') .bind('command', function() { w.driver.goToURL({ url: w.config.websiteURL + 'contact' }) diff --git a/drivers/firefox/content/xul/preferences.xul b/drivers/firefox/content/xul/preferences.xul index 3ae791df0..e1d3aee1c 100755 --- a/drivers/firefox/content/xul/preferences.xul +++ b/drivers/firefox/content/xul/preferences.xul @@ -6,8 +6,15 @@ - + + + + + + + + @@ -37,153 +44,114 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/firefox/content/xul/wappalyzer.xul b/drivers/firefox/content/xul/wappalyzer.xul index aa398aafc..cad1a1a3d 100755 --- a/drivers/firefox/content/xul/wappalyzer.xul +++ b/drivers/firefox/content/xul/wappalyzer.xul @@ -18,8 +18,6 @@ - - diff --git a/drivers/firefox/defaults/preferences/defaults.js b/drivers/firefox/defaults/preferences/defaults.js index 266967266..d7bac6b36 100644 --- a/drivers/firefox/defaults/preferences/defaults.js +++ b/drivers/firefox/defaults/preferences/defaults.js @@ -1,37 +1,40 @@ -pref('extensions.wappalyzer.debug', false); -pref('extensions.wappalyzer.showIcons', true); -pref('extensions.wappalyzer.tracking', true); -pref('extensions.wappalyzer.addonBar', false); -pref('extensions.wappalyzer.version', ''); +pref('extensions.wappalyzer.debug', false); +pref('extensions.wappalyzer.showIcons', true); +pref('extensions.wappalyzer.tracking', true); +pref('extensions.wappalyzer.addonBar', false); +pref('extensions.wappalyzer.version', ''); +pref('extensions.wappalyzer.analyzeHeaders', true); +pref('extensions.wappalyzer.analyzeJavaScript', true); +pref('extensions.wappalyzer.analyzeOnLoad', true); -pref('extensions.wappalyzer.cat1', true); -pref('extensions.wappalyzer.cat2', true); -pref('extensions.wappalyzer.cat3', true); -pref('extensions.wappalyzer.cat4', true); -pref('extensions.wappalyzer.cat5', true); -pref('extensions.wappalyzer.cat6', true); -pref('extensions.wappalyzer.cat7', true); -pref('extensions.wappalyzer.cat8', true); -pref('extensions.wappalyzer.cat9', true); -pref('extensions.wappalyzer.cat10', true); -pref('extensions.wappalyzer.cat11', true); -pref('extensions.wappalyzer.cat12', true); -pref('extensions.wappalyzer.cat13', true); -pref('extensions.wappalyzer.cat14', true); -pref('extensions.wappalyzer.cat15', true); -pref('extensions.wappalyzer.cat16', true); -pref('extensions.wappalyzer.cat17', true); -pref('extensions.wappalyzer.cat18', true); -pref('extensions.wappalyzer.cat19', true); -pref('extensions.wappalyzer.cat20', true); -pref('extensions.wappalyzer.cat21', true); -pref('extensions.wappalyzer.cat22', true); -pref('extensions.wappalyzer.cat23', true); -pref('extensions.wappalyzer.cat24', true); -pref('extensions.wappalyzer.cat25', true); -pref('extensions.wappalyzer.cat26', true); -pref('extensions.wappalyzer.cat27', true); -pref('extensions.wappalyzer.cat28', true); -pref('extensions.wappalyzer.cat29', true); -pref('extensions.wappalyzer.cat30', true); -pref('extensions.wappalyzer.cat31', true); +pref('extensions.wappalyzer.cat1', true); +pref('extensions.wappalyzer.cat2', true); +pref('extensions.wappalyzer.cat3', true); +pref('extensions.wappalyzer.cat4', true); +pref('extensions.wappalyzer.cat5', true); +pref('extensions.wappalyzer.cat6', true); +pref('extensions.wappalyzer.cat7', true); +pref('extensions.wappalyzer.cat8', true); +pref('extensions.wappalyzer.cat9', true); +pref('extensions.wappalyzer.cat10', true); +pref('extensions.wappalyzer.cat11', true); +pref('extensions.wappalyzer.cat12', true); +pref('extensions.wappalyzer.cat13', true); +pref('extensions.wappalyzer.cat14', true); +pref('extensions.wappalyzer.cat15', true); +pref('extensions.wappalyzer.cat16', true); +pref('extensions.wappalyzer.cat17', true); +pref('extensions.wappalyzer.cat18', true); +pref('extensions.wappalyzer.cat19', true); +pref('extensions.wappalyzer.cat20', true); +pref('extensions.wappalyzer.cat21', true); +pref('extensions.wappalyzer.cat22', true); +pref('extensions.wappalyzer.cat23', true); +pref('extensions.wappalyzer.cat24', true); +pref('extensions.wappalyzer.cat25', true); +pref('extensions.wappalyzer.cat26', true); +pref('extensions.wappalyzer.cat27', true); +pref('extensions.wappalyzer.cat28', true); +pref('extensions.wappalyzer.cat29', true); +pref('extensions.wappalyzer.cat30', true); +pref('extensions.wappalyzer.cat31', true); diff --git a/drivers/firefox/install.rdf b/drivers/firefox/install.rdf index bbdc06d4d..27e02141c 100644 --- a/drivers/firefox/install.rdf +++ b/drivers/firefox/install.rdf @@ -3,7 +3,7 @@ wappalyzer@crunchlabz.com - 2.3.4 + 2.4.0 2 true @@ -16,9 +16,9 @@ - + chrome://wappalyzer/content/xul/preferences.xul + 3 + chrome://wappalyzer/skin/images/icon128x128.png Wappalyzer Identifies software on the web. diff --git a/drivers/firefox/locale/de-DE/wappalyzer.dtd b/drivers/firefox/locale/de-DE/wappalyzer.dtd index 408e5fd3c..ecddadb74 100755 --- a/drivers/firefox/locale/de-DE/wappalyzer.dtd +++ b/drivers/firefox/locale/de-DE/wappalyzer.dtd @@ -1,49 +1,51 @@ - - + + - - - - - - - + + + + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/firefox/locale/en-US/wappalyzer.dtd b/drivers/firefox/locale/en-US/wappalyzer.dtd index 47e3f5b14..904f910ee 100755 --- a/drivers/firefox/locale/en-US/wappalyzer.dtd +++ b/drivers/firefox/locale/en-US/wappalyzer.dtd @@ -1,48 +1,52 @@ - - + + - - - - - - + + + + + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/firefox/locale/fr-FR/wappalyzer.dtd b/drivers/firefox/locale/fr-FR/wappalyzer.dtd index c81afc93f..5f2dd2bcf 100644 --- a/drivers/firefox/locale/fr-FR/wappalyzer.dtd +++ b/drivers/firefox/locale/fr-FR/wappalyzer.dtd @@ -1,48 +1,51 @@ - - + + - - - - - - + + + + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/firefox/locale/nl-NL/wappalyzer.dtd b/drivers/firefox/locale/nl-NL/wappalyzer.dtd index 6f51023c5..852d4af44 100755 --- a/drivers/firefox/locale/nl-NL/wappalyzer.dtd +++ b/drivers/firefox/locale/nl-NL/wappalyzer.dtd @@ -1,47 +1,50 @@ - - + + - - - - - - + + + + + + + + + + + - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/firefox/icon.png b/drivers/firefox/skin/images/icon128x128.png similarity index 100% rename from drivers/firefox/icon.png rename to drivers/firefox/skin/images/icon128x128.png diff --git a/drivers/firefox/skin/images/icon64x64.png b/drivers/firefox/skin/images/icon64x64.png new file mode 100644 index 000000000..58d6a0edc Binary files /dev/null and b/drivers/firefox/skin/images/icon64x64.png differ