Renamed firefox driver to firefox-xuy, firefox-sdk to firefox. FF driver now works with new windows

main
Elbert Alias 11 years ago
parent 71a98f4611
commit d797444ae3

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 716 B

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 634 B

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

@ -6,8 +6,6 @@
main = require('wappalyzer'), main = require('wappalyzer'),
w = main.wappalyzer, w = main.wappalyzer,
mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator), mediator = Cc['@mozilla.org/appshell/window-mediator;1'].getService(Ci.nsIWindowMediator),
doc = mediator.getMostRecentWindow('navigator:browser').document,
urlBar = doc.getElementById('urlbar-icons'),
tabCache = {}, tabCache = {},
headersCache = {}, headersCache = {},
categoryNames = {}, categoryNames = {},
@ -21,7 +19,9 @@
addIcon, addIcon,
removeIcons, removeIcons,
createPanel, createPanel,
createWidget; createWidget,
getUrlBar,
getDocument;
initTab = function(tab) { initTab = function(tab) {
tabCache[tab.id] = { count: 0, appsDetected: [] }; tabCache[tab.id] = { count: 0, appsDetected: [] };
@ -65,10 +65,9 @@
addIcon = function(url) { addIcon = function(url) {
var var
icon = doc.createElement('image'), icon = getDocument().createElement('image'),
show = true; show = true;
icon.setAttribute('src', data.url(url)); icon.setAttribute('src', data.url(url));
icon.setAttribute('class', 'wappalyzer-icon'); icon.setAttribute('class', 'wappalyzer-icon');
icon.setAttribute('width', '16'); icon.setAttribute('width', '16');
@ -97,7 +96,7 @@
} }
}, false); }, false);
urlBar.appendChild(icon); getUrlBar().appendChild(icon);
return icon; return icon;
}; };
@ -106,10 +105,10 @@
var icons; var icons;
do { do {
icons = urlBar.getElementsByClassName('wappalyzer-icon'); icons = getUrlBar().getElementsByClassName('wappalyzer-icon');
if ( icons.length ) { if ( icons.length ) {
urlBar.removeChild(icons[0]); getUrlBar().removeChild(icons[0]);
} }
} while ( icons.length ); } while ( icons.length );
}; };
@ -143,6 +142,14 @@
}); });
} }
getUrlBar = function() {
return getDocument().getElementById('urlbar-icons');
}
getDocument = function() {
return mediator.getMostRecentWindow('navigator:browser').document;
}
w.driver = { w.driver = {
/** /**
* Log messages to console * Log messages to console
@ -157,6 +164,8 @@
init: function(callback) { init: function(callback) {
var json = JSON.parse(data.load('apps.json')); var json = JSON.parse(data.load('apps.json'));
console.log('xxxx');
if ( sp.prefs.urlbar ) { if ( sp.prefs.urlbar ) {
createPanel(); createPanel();
} else { } else {

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
ln -f share/images/icons/*.png drivers/firefox/skin/images/icons ln -f share/images/icons/*.png drivers/firefox-xul/skin/images/icons
ln -f share/apps.json drivers/firefox/content ln -f share/apps.json drivers/firefox-xul/content
ln -f share/js/wappalyzer.js drivers/firefox/content/js ln -f share/js/wappalyzer.js drivers/firefox-xul/content/js
ln -f share/images/icons/*.png drivers/firefox-sdk/data/images/icons ln -f share/images/icons/*.png drivers/firefox/data/images/icons
ln -f share/apps.json drivers/firefox-sdk/data ln -f share/apps.json drivers/firefox/data
ln -f share/js/wappalyzer.js drivers/firefox-sdk/lib ln -f share/js/wappalyzer.js drivers/firefox/lib
ln -f share/images/icons/*.png drivers/chrome/images/icons ln -f share/images/icons/*.png drivers/chrome/images/icons
ln -f share/apps.json drivers/chrome ln -f share/apps.json drivers/chrome

@ -53,8 +53,8 @@ cd drivers\chrome&&%zip% a -tzip -mx9 ..\..\wappalyzer-chrome.zip *
cd..\.. cd..\..
::Pack Firefox extension ::Pack Firefox extension
cd drivers\firefox&&%zip% a -tzip -mx9 ..\..\wappalyzer-firefox.xpi * ::cd drivers\firefox&&%zip% a -tzip -mx9 ..\..\wappalyzer-firefox.xpi *
cd..\.. ::cd..\..
:end :end

@ -7,4 +7,4 @@ path=`pwd`
rm -f wappalyzer-chrome.zip wappalyzer-firefox.xpi rm -f wappalyzer-chrome.zip wappalyzer-firefox.xpi
cd $path/drivers/chrome && zip -r $path/wappalyzer-chrome.zip . cd $path/drivers/chrome && zip -r $path/wappalyzer-chrome.zip .
cd $path/drivers/firefox && zip -r $path/wappalyzer-firefox.xpi . #cd $path/drivers/firefox && zip -r $path/wappalyzer-firefox.xpi .

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 3.5 KiB