Merge pull request #1 from ElbertF/master

Update
main
P THE AWESOME 11 years ago
commit d4a29609ad

2
.gitignore vendored

@ -6,4 +6,6 @@ drivers/**/apps.json
drivers/**/wappalyzer.js drivers/**/wappalyzer.js
drivers/**/icons/*.png drivers/**/icons/*.png
!.gitkeep
node_modules/* node_modules/*

@ -1,5 +0,0 @@
apps.json
wappalyzer.js
icons/
/bookmarklet/json

@ -13,15 +13,35 @@
ss = require('sdk/simple-storage'), ss = require('sdk/simple-storage'),
sp = require("sdk/simple-prefs"), sp = require("sdk/simple-prefs"),
tabs = require('sdk/tabs'), tabs = require('sdk/tabs'),
initTab,
Panel,
panel, panel,
Widget,
widget, widget,
initTab, UrlBar,
addIcon, urlBar;
removeIcons,
createPanel, exports.main = function(options, callbacks) {
createWidget, w.log('main: ' + options.loadReason);
getUrlBar,
getDocument; w.init();
};
exports.onUnload = function(reason) {
w.log('unload: ' + reason);
if ( urlBar ) {
urlBar.destroy();
}
if ( widget ) {
widget.destroy();
}
if ( panel ) {
panel.destroy();
}
};
initTab = function(tab) { initTab = function(tab) {
tabCache[tab.id] = { count: 0, appsDetected: [] }; tabCache[tab.id] = { count: 0, appsDetected: [] };
@ -34,7 +54,7 @@
worker.port.on('analyze', function(message) { worker.port.on('analyze', function(message) {
var url = message.url.replace(/#.*$/, ''); var url = message.url.replace(/#.*$/, '');
if ( headersCache[url] !== undefined ) { if ( typeof headersCache[url] !== 'undefined' ) {
message.analyze.headers = headersCache[url]; message.analyze.headers = headersCache[url];
} }
@ -57,42 +77,10 @@
w.driver.displayApps(); w.driver.displayApps();
}); });
addIcon = function(appName) { Panel = function() {
var var self = this;
icon = getDocument().createElement('image'),
url = appName !== undefined ? 'images/icons/' + appName + '.png' : 'images/icon32.png',
tooltipText = ( appName !== undefined ? appName + ' - ' + require('sdk/l10n').get('clickForDetails') + ' - ' : '' ) + require('sdk/l10n').get('name');
icon.setAttribute('src', data.url(url));
icon.setAttribute('class', 'wappalyzer-icon');
icon.setAttribute('width', '16');
icon.setAttribute('height', '16');
icon.setAttribute('style', 'margin: 0 1px;');
icon.setAttribute('tooltiptext', tooltipText);
getUrlBar().appendChild(icon); this.panel = require('sdk/panel').Panel({
return icon;
};
removeIcons = function() {
var icons;
do {
icons = getUrlBar().getElementsByClassName('wappalyzer-icon');
if ( icons.length ) {
getUrlBar().removeChild(icons[0]);
}
} while ( icons.length );
};
createPanel = function() {
if ( panel ) {
panel.destroy();
}
panel = require('sdk/panel').Panel({
width: 250, width: 250,
height: 50, height: 50,
contentURL: data.url('panel.html'), contentURL: data.url('panel.html'),
@ -100,70 +88,106 @@
position: { right: 30, top: 30 } position: { right: 30, top: 30 }
}); });
panel.port.on('resize', function(height) { this.panel.port.on('resize', function(height) {
panel.height = height; self.panel.height = height;
}); });
panel.port.on('goToUrl', function(url) { this.panel.port.on('goToUrl', function(url) {
panel.hide(); self.panel.hide();
w.driver.goToURL({ url: w.config.websiteURL + url, medium: 'panel' }); w.driver.goToURL({ url: w.config.websiteURL + url, medium: 'panel' });
}); });
} };
createWidget = function() { Panel.prototype.get = function() {
createPanel(); return this.panel;
};
widget = require('sdk/widget').Widget({ Panel.prototype.destroy = function() {
this.panel.destroy();
};
Widget = function(panel) {
this.widget = require('sdk/widget').Widget({
id: 'wappalyzer', id: 'wappalyzer',
label: 'Wappalyzer', label: 'Wappalyzer',
contentURL: data.url('images/icon32.png'), contentURL: data.url('images/icon32.png'),
panel: panel panel: panel.get()
}); });
} };
Widget.prototype.get = function() {
return this.widget;
};
Widget.prototype.destroy = function() {
this.widget.destroy();
};
UrlBar = function(panel) {
var self = this;
this.panel = panel;
this.onClick = function() {
self.panel.get().show();
}
this.document = mediator.getMostRecentWindow('navigator:browser').document;
this.urlBar = this.document.createElement('hbox');
this.urlBar.setAttribute('id', 'wappalyzer-urlbar');
this.urlBar.setAttribute('style', 'cursor: pointer; margin: 0 2px;');
this.urlBar.setAttribute('tooltiptext', require('sdk/l10n').get('name'));
getUrlBar = function() { this.urlBar.addEventListener('click', this.onClick);
this.document.getElementById('urlbar-icons').appendChild(this.urlBar);
};
UrlBar.prototype.get = function() {
return this.urlBar;
};
UrlBar.prototype.addIcon = function(appName) {
var var
urlBar = getDocument().getElementById('wappalyzer-urlbar'), icon = this.document.createElement('image'),
show = true; url = typeof appName !== 'undefined' ? 'images/icons/' + appName + '.png' : 'images/icon32.png',
tooltipText = ( typeof appName !== 'undefined' ? appName + ' - ' + require('sdk/l10n').get('clickForDetails') + ' - ' : '' ) + require('sdk/l10n').get('name');
if ( !urlBar ) { icon.setAttribute('src', data.url(url));
urlBar = getDocument().createElement('hbox'); icon.setAttribute('class', 'wappalyzer-icon');
icon.setAttribute('width', '16');
icon.setAttribute('height', '16');
icon.setAttribute('style', 'margin: 0 1px;');
icon.setAttribute('tooltiptext', tooltipText);
urlBar.setAttribute('id', 'wappalyzer-urlbar'); this.get().appendChild(icon);
urlBar.setAttribute('style', 'cursor: pointer; margin: 0 2px;');
urlBar.setAttribute('tooltiptext', require('sdk/l10n').get('name'));
urlBar.addEventListener('mouseover', function() { return this;
if ( panel.isShowing ) { };
show = false;
}
});
urlBar.addEventListener('mouseout', function() { UrlBar.prototype.clear = function() {
show = true; var icons;
});
urlBar.addEventListener('click', function() { do {
if ( show ) { icons = this.get().getElementsByClassName('wappalyzer-icon');
panel.show();
show = false; if ( icons.length ) {
} else { urlBar.get().removeChild(icons[0]);
panel.hide(); }
} while ( icons.length );
show = true; return this;
} };
}, false);
getDocument().getElementById('urlbar-icons').appendChild(urlBar); UrlBar.prototype.destroy = function() {
} this.urlBar.removeEventListener('click', this.onClick);
return urlBar; this.urlBar.remove();
}
getDocument = function() { return this;
return mediator.getMostRecentWindow('navigator:browser').document;
} }
w.driver = { w.driver = {
@ -180,10 +204,14 @@
init: function(callback) { init: function(callback) {
var json = JSON.parse(data.load('apps.json')); var json = JSON.parse(data.load('apps.json'));
w.log('driver.init');
panel = new Panel();
if ( sp.prefs.urlbar ) { if ( sp.prefs.urlbar ) {
createPanel(); urlBar = new UrlBar(panel);
} else { } else {
createWidget(); widget = new Widget(panel);
} }
try { try {
@ -210,14 +238,16 @@
} }
sp.on('urlbar', function() { sp.on('urlbar', function() {
panel = new Panel();
if ( !sp.prefs.urlbar ) { if ( !sp.prefs.urlbar ) {
removeIcons(); urlBar.destroy();
createWidget(); widget = new Widget(panel);
} else { } else {
widget.destroy(); urlBar = new UrlBar(panel);
createPanel(); widget.get().destroy();
} }
w.driver.displayApps(); w.driver.displayApps();
@ -246,7 +276,7 @@
} }
if ( subject.contentType === 'text/html' ) { if ( subject.contentType === 'text/html' ) {
if ( headersCache[uri] === undefined ) { if ( typeof headersCache[uri] === 'undefined' ) {
headersCache[uri] = {}; headersCache[uri] = {};
} }
@ -258,12 +288,14 @@
}; };
httpRequestObserver.init(); httpRequestObserver.init();
w.driver.displayApps();
}, },
goToURL: function(args) { goToURL: function(args) {
var url = args.url + ( typeof args.medium === 'undefined' ? '' : '?pk_campaign=firefox&pk_kwd=' + args.medium); var url = args.url + ( typeof args.medium === 'undefined' ? '' : '?pk_campaign=firefox&pk_kwd=' + args.medium);
tabs.open({ url: url, inBackground: args.background !== undefined && args.background }); tabs.open({ url: url, inBackground: typeof args.background !== 'undefined' && args.background });
}, },
displayApps: function() { displayApps: function() {
@ -273,15 +305,17 @@
w.log('display apps'); w.log('display apps');
if ( panel === undefined ) { if ( !panel.get() ) {
panel = new Panel();
if ( sp.prefs.urlbar ) { if ( sp.prefs.urlbar ) {
createPanel(); urlBar = new UrlBar(panel);
} else { } else {
createWidget(); widget = new Widget(panel);
} }
} }
if ( tabCache[tabs.activeTab.id] === undefined ) { if ( typeof tabCache[tabs.activeTab.id] === 'undefined' ) {
initTab(tabs.activeTab); initTab(tabs.activeTab);
} }
@ -289,18 +323,18 @@
tabCache[tabs.activeTab.id].appsDetected = w.detected[url]; tabCache[tabs.activeTab.id].appsDetected = w.detected[url];
if ( sp.prefs.urlbar ) { if ( sp.prefs.urlbar ) {
removeIcons(); urlBar.clear();
// Add icons // Add icons
if ( count ) { if ( count ) {
for ( appName in tabCache[tabs.activeTab.id].appsDetected ) { for ( appName in tabCache[tabs.activeTab.id].appsDetected ) {
addIcon(appName); urlBar.addIcon(appName);
} }
} else { } else {
addIcon(); urlBar.addIcon();
} }
} else { } else {
widget.contentURL = data.url('images/icon32_hot.png'); widget.get().contentURL = data.url('images/icon32_hot.png');
if ( count ) { if ( count ) {
// Find the main application to display // Find the main application to display
@ -312,7 +346,7 @@
for ( appName in w.detected[url] ) { for ( appName in w.detected[url] ) {
w.apps[appName].cats.forEach(function(cat) { w.apps[appName].cats.forEach(function(cat) {
if ( cat == match && !found ) { if ( cat == match && !found ) {
widget.contentURL = data.url('images/icons/' + appName + '.png'), widget.get().contentURL = data.url('images/icons/' + appName + '.png'),
found = true; found = true;
} }
@ -322,7 +356,7 @@
} }
} }
panel.port.emit('displayApps', { tabCache: tabCache[tabs.activeTab.id], apps: w.apps, categories: w.categories, categoryNames: categoryNames }); panel.get().port.emit('displayApps', { tabCache: tabCache[tabs.activeTab.id], apps: w.apps, categories: w.categories, categoryNames: categoryNames });
}, },
ping: function() { ping: function() {
@ -386,7 +420,5 @@
36, // Advertising Network 36, // Advertising Network
19 // Miscellaneous 19 // Miscellaneous
] ]
} };
w.init();
}()); }());

@ -8,7 +8,7 @@
"description": "Identifies software on the web", "description": "Identifies software on the web",
"author": "Elbert Alias", "author": "Elbert Alias",
"license": "GPLv3", "license": "GPLv3",
"version": "3.0.5", "version": "3.0.8",
"main": "driver", "main": "driver",
"preferences": [{ "preferences": [{
"name": "tracking", "name": "tracking",

@ -24,7 +24,4 @@ ln -f share/apps.json drivers/php
ln -f share/js/wappalyzer.js drivers/php/js ln -f share/js/wappalyzer.js drivers/php/js
ln -f share/apps.json drivers/python ln -f share/apps.json drivers/python
if [ ! -d "drivers/python/js" ];then ln -f share/js/wappalyzer.js drivers/python/js
mkdir drivers/python/js/
fi
ln -f share/js/wappalyzer.js drivers/python/js

@ -1,19 +0,0 @@
{
"name": "Wappalyzer",
"version": "1.1.2",
"description": "Wappalyzer is a cross-platform utility that uncovers the technologies used on websites. It detects content management systems, web shops, web servers, JavaScript frameworks, analytics tools and many more.",
"main": "./share/js/wappalyzer.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/ElbertF/Wappalyzer"
},
"author": "ElbertF",
"license": "GNU GPL",
"bugs": {
"url": "https://github.com/ElbertF/Wappalyzer/issues"
},
"homepage": "https://wappalyzer.com/"
}

@ -787,6 +787,12 @@
"meta": { "generator": "Doxygen ([\\d.]+)\\;version:\\1" }, "meta": { "generator": "Doxygen ([\\d.]+)\\;version:\\1" },
"html": "(?:<!-- Generated by Doxygen ([\\d.]+)|<link[^>]+doxygen.css)\\;version:\\1" "html": "(?:<!-- Generated by Doxygen ([\\d.]+)|<link[^>]+doxygen.css)\\;version:\\1"
}, },
"DTG": {
"website": "www.dtg.nl",
"cats": [ 1 ],
"html": [ "<a href=\"http://www\\.dtg\\.nl/\"[^>]+>Site Powered by DTG", "var u=\\(\\('https:' == d\\.location\\.protocol\\) \\? 'https://resellerstat\\.mono\\.net/dtg/' : 'http://resellerstat\\.mono\\.net/dtg/'\\);" ],
"implies": "Mono.net"
},
"DreamWeaver": { "DreamWeaver": {
"website": "www.adobe.com/products/dreamweaver", "website": "www.adobe.com/products/dreamweaver",
"cats": [ 20 ], "cats": [ 20 ],
@ -1661,6 +1667,16 @@
"cats": [ 27 ], "cats": [ 27 ],
"headers": { "X-Powered-By": "\\bLua(?: ([\\d.]+))?\\;version:\\1" } "headers": { "X-Powered-By": "\\bLua(?: ([\\d.]+))?\\;version:\\1" }
}, },
"M.R. Inc Webserver": {
"website": "mrincworld.com",
"cats": [ 22 ],
"headers": { "Server": "M\\.R\\. Inc Inc Webserver" }
},
"M.R. Inc Wild CMS": {
"website": "mrincworld.com",
"cats": [ 1, 6 ],
"headers": { "X-Powered-By": "M\\.R\\. Inc Inc Wild CMS" }
},
"Magento": { "Magento": {
"website": "www.magentocommerce.com", "website": "www.magentocommerce.com",
"cats": [ 6 ], "cats": [ 6 ],
@ -1672,7 +1688,8 @@
"Mambo": { "Mambo": {
"website": "mambo-foundation.org", "website": "mambo-foundation.org",
"cats": [ 1 ], "cats": [ 1 ],
"meta": { "generator": "Mambo" } "meta": { "generator": "Mambo" },
"excludes": "Joomla"
}, },
"MantisBT": { "MantisBT": {
"website": "www.mantisbt.org", "website": "www.mantisbt.org",
@ -1886,6 +1903,14 @@
"cats": [ 18 ], "cats": [ 18 ],
"headers": { "X-Powered-By": "Mono" } "headers": { "X-Powered-By": "Mono" }
}, },
"Mono.net": {
"website": "www.mono.net",
"cats": [ 1 ],
"script": "monotracker\\.js",
"env": "_monoTracker",
"html": "var u=\\(\\('https:' == d\\.location\\.protocol\\) \\? 'https://resellerstat\\.mono\\.net/mono/' : 'http://resellerstat\\.mono\\.net/mono/'\\);",
"implies": "Piwik"
},
"Moodle": { "Moodle": {
"website": "moodle.org", "website": "moodle.org",
"cats": [ 21 ], "cats": [ 21 ],
@ -1910,16 +1935,6 @@
"cats": [ 1 ], "cats": [ 1 ],
"meta": { "generator": "Movable Type" } "meta": { "generator": "Movable Type" }
}, },
"M.R. Inc Webserver": {
"website": "mrincworld.com",
"cats": [ 22 ],
"headers": { "Server": "M\\.R\\. Inc Inc Webserver" }
},
"M.R. Inc Wild CMS": {
"website": "mrincworld.com",
"cats": [ 1, 6 ],
"headers": { "X-Powered-By": "M\\.R\\. Inc Inc Wild CMS" }
},
"Mura CMS": { "Mura CMS": {
"website": "www.getmura.com", "website": "www.getmura.com",
"cats": [ 1, 11 ], "cats": [ 1, 11 ],
@ -1962,6 +1977,12 @@
"script": "netmonitor\\.fi/nmtracker\\.js", "script": "netmonitor\\.fi/nmtracker\\.js",
"env": "^netmonitor$" "env": "^netmonitor$"
}, },
"Nette Framework": {
"website": "nette.org",
"cats": [ 18 ],
"headers": {"X-Powered-By": "Nette Framework"},
"implies": "PHP"
},
"New Relic": { "New Relic": {
"website": "newrelic.com", "website": "newrelic.com",
"cats": [ 10 ], "cats": [ 10 ],
@ -2586,13 +2607,6 @@
"cats": [ 1 ], "cats": [ 1 ],
"meta": { "generator": "SiteEdit" } "meta": { "generator": "SiteEdit" }
}, },
"Skimlinks": {
"website": "skimlinks.com",
"cats": [ 36 ],
"script": "^https?://(?:[^/]+\\.)?skimresources\\.com/",
"html": "<a [^>]*href=\"https?://go\\.redirectingat\\.com/",
"env": "^skim(?:links|words)_"
},
"Smart Ad Server": { "Smart Ad Server": {
"website": "smartadserver.com", "website": "smartadserver.com",
"cats": [ 36 ], "cats": [ 36 ],
@ -2865,15 +2879,27 @@
"meta": { "generator": "typepad" }, "meta": { "generator": "typepad" },
"url": "typepad\\.com" "url": "typepad\\.com"
}, },
"TYPO3": { "TYPO3 CMS": {
"website": "typo3.com", "website": "www.typo3.org",
"cats": [ 1 ], "cats": [ 1 ],
"headers": { "Set-Cookie": "fe_typo_user" }, "meta": { "generator": "TYPO3\\s+(?:CMS\\s+)?([\\d.]+)?(?:\\s+CMS)?\\;version:\\1" },
"meta": { "generator": "TYPO3\\s?([\\d.]+)?\\;version:\\1" },
"html": "(?:<(?:script[^>]* src|link[^>]* href)=[^>]*fileadmin|<!--TYPO3SEARCH)",
"url": "/typo3/", "url": "/typo3/",
"implies": "PHP" "implies": "PHP"
}, },
"TYPO3 Flow": {
"website": "flow.typo3.org",
"cats": [ 18 ],
"headers": { "X-Flow-Powered": "Flow\\/(.+)?$\\;version:\\1" },
"implies": "PHP"
},
"TYPO3 Neos": {
"website": "neos.typo3.org",
"cats": [ 1 ],
"html": "xmlns:typo3=\\\"http:\\/\\/www\\.typo3\\.org\\/ns\\/[0-9]{4}\\/Flow\\/Packages\\/Neos\\/Content\\/",
"url": "/neos/",
"implies": [ "PHP", "TYPO3 Flow" ],
"excludes": "TYPO3 CMS"
},
"Ubercart": { "Ubercart": {
"website": "www.ubercart.org", "website": "www.ubercart.org",
"cats": [ 6 ], "cats": [ 6 ],

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

@ -387,8 +387,11 @@ var wappalyzer = (function() {
if ( !apps[app].detected ) { if ( !apps[app].detected ) {
delete apps[app]; delete apps[app];
} }
}
if ( w.apps[app].excludes ) { // Exclude app in detected apps only
for ( app in apps ) {
if (w.apps[app].excludes ) {
if ( typeof w.apps[app].excludes === 'string' ) { if ( typeof w.apps[app].excludes === 'string' ) {
w.apps[app].excludes = [ w.apps[app].excludes ]; w.apps[app].excludes = [ w.apps[app].excludes ];
} }