From abf3e5f2abf88f917ffff17c42ebcfbda0ce1556 Mon Sep 17 00:00:00 2001 From: ElbertF Date: Tue, 1 Nov 2011 13:11:32 +1100 Subject: [PATCH] Cleaned up code dealing with categories, fixed FF XML tree display, fixed global variable to avoid conflicts --- chrome/content/content.js | 10 +++++-- chrome/content/options.js | 19 ++++++++++++ chrome/content/options.xul | 25 ++-------------- chrome/content/wappalyzer.js | 55 ++++++++++++++--------------------- install.rdf | 4 +-- wappalyzer.xpi | Bin 309881 -> 0 bytes 6 files changed, 53 insertions(+), 60 deletions(-) create mode 100644 chrome/content/options.js delete mode 100644 wappalyzer.xpi 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 @@