diff --git a/chrome/content/content.js b/chrome/content/content.js
index 4058c4b42..c7c23f1da 100644
--- a/chrome/content/content.js
+++ b/chrome/content/content.js
@@ -1,5 +1,5 @@
(function() {
- self = {
+ var self = {
element: false,
prevUrl: '',
@@ -10,6 +10,8 @@
},
log: function(message) {
+ return; //
+
var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
consoleService.logStringMessage("Wappalyzer content.js: " + message);
@@ -61,6 +63,10 @@
getEnvironmentVars: function() {
self.log('getEnvironmentVars');
+ if ( content.document.contentType != 'text/html' ) {
+ return;
+ }
+
var environmentVars = '';
try {
@@ -112,5 +118,5 @@
self.init();
- return app;
+ return self;
})();
diff --git a/chrome/content/options.js b/chrome/content/options.js
new file mode 100644
index 000000000..292fdcda6
--- /dev/null
+++ b/chrome/content/options.js
@@ -0,0 +1,19 @@
+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/chrome/content/options.xul b/chrome/content/options.xul
index dba4fa01d..d9828bdb9 100755
--- a/chrome/content/options.xul
+++ b/chrome/content/options.xul
@@ -12,6 +12,7 @@
+
@@ -20,29 +21,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/chrome/content/wappalyzer.js b/chrome/content/wappalyzer.js
index d0b27022d..7a7560261 100644
--- a/chrome/content/wappalyzer.js
+++ b/chrome/content/wappalyzer.js
@@ -1,7 +1,7 @@
// Wappalyzer by ElbertF 2009 http://elbertf.com
var wappalyzer = (function() {
- self = {
+ var self = {
apps: {},
appsDetected: 0,
browser: false,
@@ -50,8 +50,14 @@ var wappalyzer = (function() {
self.newInstall = self.prefs.getBoolPref('newInstall');
self.version = self.prefs.getCharPref('version');
- for ( var i = 1; i <= 23; i ++ ) {
- self.showCats[i] = self.prefs.getBoolPref('cat' + i);
+ var i = 0;
+
+ while ( ++ i ) {
+ try {
+ self.showCats[i] = self.prefs.getBoolPref('cat' + i);
+ } catch (e) {
+ break;
+ }
}
var locationPref = self.prefs.getIntPref('location');
@@ -113,58 +119,41 @@ var wappalyzer = (function() {
return;
}
- switch(data) {
- case 'customApps':
+ switch(true) {
+ case data == 'customApps':
self.customApps = self.prefs.getCharPref('customApps');
break;
- case 'debug':
+ case data == 'debug':
self.debug = self.prefs.getBoolPref('debug');
break;
- case 'enableTracking':
+ case data == 'enableTracking':
self.enableTracking = self.prefs.getBoolPref('enableTracking');
break;
- case 'popupOnHover':
+ case data == 'popupOnHover':
self.popupOnHover = self.prefs.getBoolPref('popupOnHover');
self.moveLocation();
break;
- case 'showApps':
+ case data == 'showApps':
self.showApps = self.prefs.getIntPref('showApps');
break;
- case 'location':
+ case data == 'location':
var locationPref = self.prefs.getIntPref('location');
self.moveLocation(locationPref);
break;
- case 'cat1': self.showCats[ 1] = self.prefs.getIntPref( 'cat1'); break;
- case 'cat2': self.showCats[ 2] = self.prefs.getIntPref( 'cat2'); break;
- case 'cat3': self.showCats[ 3] = self.prefs.getIntPref( 'cat3'); break;
- case 'cat4': self.showCats[ 4] = self.prefs.getIntPref( 'cat4'); break;
- case 'cat5': self.showCats[ 5] = self.prefs.getIntPref( 'cat5'); break;
- case 'cat6': self.showCats[ 6] = self.prefs.getIntPref( 'cat6'); break;
- case 'cat7': self.showCats[ 7] = self.prefs.getIntPref( 'cat7'); break;
- case 'cat8': self.showCats[ 8] = self.prefs.getIntPref( 'cat8'); break;
- case 'cat9': self.showCats[ 9] = self.prefs.getIntPref( 'cat9'); break;
- case 'cat10': self.showCats[10] = self.prefs.getIntPref('cat10'); break;
- case 'cat11': self.showCats[11] = self.prefs.getIntPref('cat11'); break;
- case 'cat12': self.showCats[12] = self.prefs.getIntPref('cat12'); break;
- case 'cat13': self.showCats[13] = self.prefs.getIntPref('cat13'); break;
- case 'cat14': self.showCats[14] = self.prefs.getIntPref('cat14'); break;
- case 'cat15': self.showCats[15] = self.prefs.getIntPref('cat15'); break;
- case 'cat16': self.showCats[16] = self.prefs.getIntPref('cat16'); break;
- case 'cat17': self.showCats[17] = self.prefs.getIntPref('cat17'); break;
- case 'cat18': self.showCats[18] = self.prefs.getIntPref('cat18'); break;
- case 'cat19': self.showCats[19] = self.prefs.getIntPref('cat19'); break;
- case 'cat20': self.showCats[20] = self.prefs.getIntPref('cat20'); break;
- case 'cat21': self.showCats[21] = self.prefs.getIntPref('cat21'); break;
- case 'cat22': self.showCats[22] = self.prefs.getIntPref('cat22'); break;
- case 'cat23': self.showCats[23] = self.prefs.getIntPref('cat23'); break;
+ case data.test(/^cat[0-9]+$/):
+ var cat = data.replace(/^cat([0-9]+)$/, '$1');
+
+ self.showCats[cat] = self.prefs.getIntPref('cat' + cat);
+
+ break;
}
},
diff --git a/install.rdf b/install.rdf
index 2a0eb4572..6348deaf6 100644
--- a/install.rdf
+++ b/install.rdf
@@ -3,7 +3,7 @@
wappalyzer@crunchlabz.com
- 1.16.0
+ 1.17.0
2
true
@@ -12,7 +12,7 @@
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
4.0
- 8.*
+ 9.*
diff --git a/wappalyzer.xpi b/wappalyzer.xpi
deleted file mode 100644
index b882fc1db..000000000
Binary files a/wappalyzer.xpi and /dev/null differ