diff --git a/adapters/firefox/content/js/adapter.js b/adapters/firefox/content/js/adapter.js
index efddd488f..46347c6e8 100644
--- a/adapters/firefox/content/js/adapter.js
+++ b/adapters/firefox/content/js/adapter.js
@@ -7,16 +7,18 @@
var w = wappalyzer;
- var $, strings;
+ var $, prefs, strings;
w.adapter = {
/**
* Log messages to console
*/
log: function(args) {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
+ if ( prefs != null && prefs.getBoolPref('debug') ) {
+ var consoleService = Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService);
- consoleService.logStringMessage(args.message);
+ consoleService.logStringMessage(args.message);
+ }
},
/**
@@ -31,8 +33,6 @@
strings = document.getElementById('wappalyzer-strings');
AddonManager.getAddonByID('wappalyzer@crunchlabz.com', function(addon) {
- addon.version = addon.version;
-
// Load jQuery
(function () {
var window;
@@ -42,6 +42,22 @@
$ = jQuery.noConflict(true);
})();
+ // Preferences
+ prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch('extensions.wappalyzer.');
+
+ container();
+
+ // Version check
+ addon.version = addon.version;
+
+ if ( !prefs.getCharPref('version') ) {
+ w.config.firstRun = true;
+ } else if ( prefs.getCharPref('version') != addon.version ) {
+ w.config.upgraded = true;
+ }
+
+ prefs.setCharPref('version', addon.version);
+
// Listen for messages from content script
messageManager.addMessageListener('wappalyzer', content);
@@ -56,7 +72,7 @@
// Get response headers
onStateChange: function(progress, request, flags, status) {
- if ( flags & Components.interfaces.nsIWebProgressListener.STATE_STOP ) {
+ if ( request.nsIHttpChannel != null && flags & Components.interfaces.nsIWebProgressListener.STATE_STOP ) {
var headers = new Object();
request.nsIHttpChannel.visitResponseHeaders(function(header, value) {
@@ -83,38 +99,68 @@
displayApps: function() {
var url = gBrowser.currentURI.spec;
- $('#wappalyzer-menu > menuitem, #wappalyzer-menu > menuseparator').remove();
+ $('#wappalyzer-container > image, #wappalyzer-menu > menuitem, #wappalyzer-menu > menuseparator').remove();
if ( w.detected[url] != null && w.detected[url].length ) {
- $('#wappalyzer-icon').attr('src', 'chrome://wappalyzer/skin/images/icon16x16_hot.ico');
+ if ( !prefs.getBoolPref('showIcons') ) {
+ var image = $('')
+ .attr('src', 'chrome://wappalyzer/skin/images/icon16x16_hot.ico')
+ ;
+
+ $('#wappalyzer-container').prepend(image);
+ }
w.detected[url].map(function(app, i) {
- var menuSeparator = $('');
+ var display = false;
- $('#wappalyzer-menu').append(menuSeparator);
+ for ( cat in w.apps[app].cats ) {
+ if ( prefs.getBoolPref('cat' + w.apps[app].cats[cat]) ) {
+ display = true;
- var menuItem = $('')
- .attr('image', 'chrome://wappalyzer/skin/images/icons/' + app + '.ico')
- .attr('label', app)
- ;
+ break;
+ }
+ }
- menuItem.bind('command', function() {
- w.adapter.goToURL({ url: w.config.websiteURL + 'stats/app/' + escape(app) });
- });
+ if ( display ) {
+ if ( prefs.getBoolPref('showIcons') ) {
+ var image = $('')
+ .attr('src', 'chrome://wappalyzer/skin/images/icons/' + app + '.ico')
+ ;
+
+ $('#wappalyzer-container').prepend(image);
+ }
- $('#wappalyzer-menu').append(menuItem);
+ var menuSeparator = $('');
+
+ $('#wappalyzer-menu').append(menuSeparator);
- for ( cat in w.apps[app].cats ) {
var menuItem = $('')
- .attr('disabled', 'true')
- .attr('label', w.categories[cat].name)
+ .attr('image', 'chrome://wappalyzer/skin/images/icons/' + app + '.ico')
+ .attr('label', app)
;
+ menuItem.bind('command', function() {
+ w.adapter.goToURL({ url: w.config.websiteURL + 'stats/app/' + escape(app) });
+ });
+
$('#wappalyzer-menu').append(menuItem);
+
+ for ( cat in w.apps[app].cats ) {
+ var menuItem = $('')
+ .attr('disabled', 'true')
+ .attr('label', w.categories[w.apps[app].cats[cat]].name)
+ ;
+
+ $('#wappalyzer-menu').append(menuItem);
+ }
}
});
} else {
- $('#wappalyzer-icon').attr('src', 'chrome://wappalyzer/skin/images/icon16x16.ico');
+ var image = $('')
+ .attr('src', 'chrome://wappalyzer/skin/images/icon16x16.ico')
+ ;
+
+ $('#wappalyzer-container').prepend(image);
var menuSeparator = $('');
@@ -133,7 +179,7 @@
* Go to URL
*/
goToURL: function(args) {
- gBrowser.addTab(args.url);
+ gBrowser.selectedTab = gBrowser.addTab(args.url);
}
};
@@ -148,5 +194,80 @@
delete msg;
}
+ /**
+ * Move container to address or addon bar
+ */
+ function container() {
+ $('#wappalyzer-container')
+ .remove()
+ .prependTo(prefs.getBoolPref('addonBar') ? $('#wappalyzer-addonbar') : $('#urlbar-icons'));
+
+ // 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.adapter.displayApps();
+ });
+
+ $(prefix + 'tracking' )
+ .attr('checked', prefs.getBoolPref('tracking') ? 'true' : 'false')
+ .bind('command', function() {
+ prefs.setBoolPref('tracking', !prefs.getBoolPref('tracking'));
+
+ $(this).attr('checked', prefs.getBoolPref('tracking') ? 'true' : 'false');
+ });
+
+ $(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();
+ });
+
+ $(prefix + 'categories')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: 'chrome://wappalyzer/content/xul/categories.xul' })
+ });
+
+ $(prefix + 'donate')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.websiteURL + 'donate/' })
+ });
+
+ $(prefix + 'feedback')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.websiteURL + '?redirect=feedback' })
+ });
+
+ $(prefix + 'website')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.websiteURL })
+ });
+
+ $(prefix + 'github' )
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.githubURL })
+ });
+
+ $(prefix + 'twitter')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.twitterURL})
+ });
+
+ $(prefix + 'gplus')
+ .bind('command', function() {
+ w.adapter.goToURL({ url: w.config.gplusURL })
+ });
+ }
+
w.init();
})();
diff --git a/adapters/firefox/content/js/options.js b/adapters/firefox/content/js/options.js
deleted file mode 100644
index 292fdcda6..000000000
--- a/adapters/firefox/content/js/options.js
+++ /dev/null
@@ -1,19 +0,0 @@
-addEventListener('load', function() {
- if ( typeof wappalyzer != undefined ) {
- var preferences = document.getElementById('wappalyzer-options')
- .getElementsByTagName('preferences')[0]
- ;
-
- if ( preferences ) {
- for ( i in wappalyzer.cats ) {
- var preference = document.createElement('preference');
-
- preference.setAttribute('id', 'wappalyzer-cat' + i);
- preference.setAttribute('name', 'wappalyzer.cat' + i);
- preference.setAttribute('type', 'bool');
-
- preferences.appendChild(preference);
- }
- }
- }
-}, false);
diff --git a/adapters/firefox/content/xul/options.xul b/adapters/firefox/content/xul/categories.xul
similarity index 53%
rename from adapters/firefox/content/xul/options.xul
rename to adapters/firefox/content/xul/categories.xul
index 15bd93743..cc6bf18c1 100755
--- a/adapters/firefox/content/xul/options.xul
+++ b/adapters/firefox/content/xul/categories.xul
@@ -1,103 +1,45 @@
-
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -191,8 +133,6 @@
-
-
@@ -206,37 +146,6 @@
-
-
-
-
-
-
-
-
-
- &wappalyzer.customBody;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/adapters/firefox/content/xul/wappalyzer.xul b/adapters/firefox/content/xul/wappalyzer.xul
index 2c5e9c915..0c60aec4d 100755
--- a/adapters/firefox/content/xul/wappalyzer.xul
+++ b/adapters/firefox/content/xul/wappalyzer.xul
@@ -15,20 +15,25 @@
-
-
+
+
+
+
diff --git a/adapters/firefox/defaults/preferences/defaults.js b/adapters/firefox/defaults/preferences/defaults.js
index 9b78d3a7d..ae978ff25 100644
--- a/adapters/firefox/defaults/preferences/defaults.js
+++ b/adapters/firefox/defaults/preferences/defaults.js
@@ -1,35 +1,31 @@
-pref('extensions.wappalyzer.autoDetect', true);
-pref('extensions.wappalyzer.debug', false);
-pref('extensions.wappalyzer.location', 0);
-pref('extensions.wappalyzer.enableTracking', true);
-pref('extensions.wappalyzer.newInstall', true);
-pref('extensions.wappalyzer.showApps', 1);
-pref('extensions.wappalyzer.customApps', '');
-pref('extensions.wappalyzer.version', '');
-pref('extensions.wappalyzer.popupOnHover', true);
+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.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.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);
diff --git a/adapters/firefox/install.rdf b/adapters/firefox/install.rdf
index 809cc20e6..6dbea9ba3 100644
--- a/adapters/firefox/install.rdf
+++ b/adapters/firefox/install.rdf
@@ -16,7 +16,9 @@
+
Wappalyzer
Wappalyzer is an add-on for Firefox that uncovers the technologies used on websites.
diff --git a/adapters/firefox/locale/en-US/wappalyzer.dtd b/adapters/firefox/locale/en-US/wappalyzer.dtd
index 6cbc2a825..a666969e5 100755
--- a/adapters/firefox/locale/en-US/wappalyzer.dtd
+++ b/adapters/firefox/locale/en-US/wappalyzer.dtd
@@ -1,34 +1,39 @@
-
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/adapters/firefox/skin/css/wappalyzer.css b/adapters/firefox/skin/css/wappalyzer.css
index e69de29bb..57ed47d34 100755
--- a/adapters/firefox/skin/css/wappalyzer.css
+++ b/adapters/firefox/skin/css/wappalyzer.css
@@ -0,0 +1,9 @@
+#wappalyzer-container {
+ margin: 0 3px;
+}
+
+ #wappalyzer-container > image {
+ height: 16px;
+ margin-left: 3px;
+ width: 16px;
+ }
diff --git a/adapters/firefox/skin/images/gplus.ico b/adapters/firefox/skin/images/gplus.ico
new file mode 100644
index 000000000..7aae1e6a2
Binary files /dev/null and b/adapters/firefox/skin/images/gplus.ico differ
diff --git a/share/images/donate.png b/share/images/donate.png
new file mode 100644
index 000000000..fc60c5e1c
Binary files /dev/null and b/share/images/donate.png differ
diff --git a/share/images/feedback.png b/share/images/feedback.png
new file mode 100644
index 000000000..d22fde8ba
Binary files /dev/null and b/share/images/feedback.png differ
diff --git a/share/images/github.ico b/share/images/github.ico
new file mode 100644
index 000000000..9db08f286
Binary files /dev/null and b/share/images/github.ico differ
diff --git a/share/images/options.png b/share/images/options.png
new file mode 100644
index 000000000..5c8213fef
Binary files /dev/null and b/share/images/options.png differ
diff --git a/share/images/twitter.ico b/share/images/twitter.ico
new file mode 100644
index 000000000..00450d4fe
Binary files /dev/null and b/share/images/twitter.ico differ
diff --git a/share/js/wappalyzer.js b/share/js/wappalyzer.js
index abc06e846..6a9a9fbc2 100644
--- a/share/js/wappalyzer.js
+++ b/share/js/wappalyzer.js
@@ -38,6 +38,7 @@ var wappalyzer = wappalyzer || (function() {
websiteURL: 'http://wappalyzer.com/',
twitterURL: 'https://twitter.com/Wappalyzer',
githubURL: 'https://github.com/ElbertF/Wappalyzer',
+ gplusURL: 'https://plus.google.com/107008529118023432137/posts',
firstRun: false,
upgraded: false