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/**/icons/*.png
!.gitkeep
node_modules/*

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

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

@ -8,7 +8,7 @@
"description": "Identifies software on the web",
"author": "Elbert Alias",
"license": "GPLv3",
"version": "3.0.5",
"version": "3.0.8",
"main": "driver",
"preferences": [{
"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/apps.json drivers/python
if [ ! -d "drivers/python/js" ];then
mkdir drivers/python/js/
fi
ln -f share/js/wappalyzer.js drivers/python/js
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" },
"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": {
"website": "www.adobe.com/products/dreamweaver",
"cats": [ 20 ],
@ -1661,6 +1667,16 @@
"cats": [ 27 ],
"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": {
"website": "www.magentocommerce.com",
"cats": [ 6 ],
@ -1672,7 +1688,8 @@
"Mambo": {
"website": "mambo-foundation.org",
"cats": [ 1 ],
"meta": { "generator": "Mambo" }
"meta": { "generator": "Mambo" },
"excludes": "Joomla"
},
"MantisBT": {
"website": "www.mantisbt.org",
@ -1886,6 +1903,14 @@
"cats": [ 18 ],
"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": {
"website": "moodle.org",
"cats": [ 21 ],
@ -1910,16 +1935,6 @@
"cats": [ 1 ],
"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": {
"website": "www.getmura.com",
"cats": [ 1, 11 ],
@ -1962,6 +1977,12 @@
"script": "netmonitor\\.fi/nmtracker\\.js",
"env": "^netmonitor$"
},
"Nette Framework": {
"website": "nette.org",
"cats": [ 18 ],
"headers": {"X-Powered-By": "Nette Framework"},
"implies": "PHP"
},
"New Relic": {
"website": "newrelic.com",
"cats": [ 10 ],
@ -2586,13 +2607,6 @@
"cats": [ 1 ],
"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": {
"website": "smartadserver.com",
"cats": [ 36 ],
@ -2865,15 +2879,27 @@
"meta": { "generator": "typepad" },
"url": "typepad\\.com"
},
"TYPO3": {
"website": "typo3.com",
"TYPO3 CMS": {
"website": "www.typo3.org",
"cats": [ 1 ],
"headers": { "Set-Cookie": "fe_typo_user" },
"meta": { "generator": "TYPO3\\s?([\\d.]+)?\\;version:\\1" },
"html": "(?:<(?:script[^>]* src|link[^>]* href)=[^>]*fileadmin|<!--TYPO3SEARCH)",
"meta": { "generator": "TYPO3\\s+(?:CMS\\s+)?([\\d.]+)?(?:\\s+CMS)?\\;version:\\1" },
"url": "/typo3/",
"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": {
"website": "www.ubercart.org",
"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 ) {
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' ) {
w.apps[app].excludes = [ w.apps[app].excludes ];
}