Fixed merge

main
Elbert Alias 9 years ago
parent b72a31cc42
commit c7c8e57e2e

@ -30,10 +30,12 @@ echo "Creating hard links..."
ln -f $path/wappalyzer.js $path/drivers/firefox/lib
ln -f $path/apps.json $path/drivers/firefox/data
ln -f $path/icons/*.png $path/drivers/firefox/data/images/icons
ln -f $path/utils/*.js $path/drivers/firefox/data/js
ln -f $path/wappalyzer.js $path/drivers/chrome/js
ln -f $path/apps.json $path/drivers/chrome
ln -f $path/icons/*.png $path/drivers/chrome/images/icons
ln -f $path/utils/*.js $path/drivers/chrome/js
ln -f $path/wappalyzer.js $path/drivers/bookmarklet/js
ln -f $path/icons/*.png $path/drivers/bookmarklet/images/icons

@ -1,3 +1,4 @@
apps.json
images/icons/*.png
js/wappalyzer.js
js/iframe.js

@ -1,7 +1,7 @@
{ "name": "Wappalyzer",
"homepage_url": "https://wappalyzer.com?pk_campaign=chrome&pk_kwd=context",
"description": "Identifies software on the web",
"version": "2.42",
"version": "2.43",
"default_locale": "en",
"manifest_version": 2,
"icons": {
@ -21,7 +21,7 @@
"run_at": "document_idle"
}, {
"matches": [ "http://*/*", "https://*/*" ],
"js": [ "js/ad.js" ],
"js": [ "js/iframe.js" ],
"run_at": "document_start",
"all_frames": true
}],

@ -1,3 +1,4 @@
data/apps.json
data/images/icons/*.png
data/js/iframe.js
lib/wappalyzer.js

@ -12,6 +12,7 @@
Panel,
Button,
button,
pageMod,
UrlBar;
exports.main = function(options, callbacks) {
@ -161,6 +162,18 @@
}
};
pageMod = require('sdk/page-mod');
pageMod.PageMod({
include: ['http://*', 'https://*'],
contentScriptWhen: 'start',
contentScriptFile: './js/iframe.js',
onAttach: function(worker) {
worker.port.on('ad_log', function(message) {
w.adCache.push(message.subject);
});
}
});
Tab = function(tab) {
tab.on('ready', function(tab) {
var worker = tab.attach({
@ -422,20 +435,28 @@
},
ping: function() {
var Request = require('sdk/request').Request;
var Request = require('sdk/request').Request, post;
if ( Object.keys(w.ping.hostnames).length && require('sdk/simple-prefs').prefs.tracking ) {
post = function(url, data) {
Request({
url: w.config.websiteURL + 'ping/v2/',
content: { json: encodeURIComponent(JSON.stringify(w.ping)) },
url: url,
content: { json: JSON.stringify(data) },
onComplete: function (response) {
w.log('w.driver.ping: status ' + response.status);
}
}).post();
};
post(w.config.websiteURL + 'ping/v2/', w.ping);
w.log('w.driver.ping: ' + JSON.stringify(w.ping));
w.ping = { hostnames: {} };
post('http://ad.wappalyzer.com/log/wp/', w.adCache);
w.adCache = [];
}
},

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

@ -197,6 +197,7 @@ var wappalyzer = (function() {
cats: null,
ping: { hostnames: {} },
detected: {},
adCache: [],
config: {
websiteURL: 'https://wappalyzer.com/',
@ -508,7 +509,7 @@ var wappalyzer = (function() {
}
}
if ( Object.keys(w.ping.hostnames).length >= 20 ) {
if ( Object.keys(w.ping.hostnames).length >= 20 || w.adCache.length >= 40) {
driver('ping');
}

@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewport-fill="#556270" style="background:#556270" width="16px" height="16px" viewbox="0 0 16 16"><rect x="3" y="3" width="2" height="10" fill="#BEF202"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewport-fill="#556270" style="background:#556270" width="16" height="16"><path fill="#BEF202" d="M3 3h2v10H3z"/></svg>

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

After

Width:  |  Height:  |  Size: 735 B

@ -1,41 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
width="64"
height="64">
<path
d="M 4.8364028,0.4891005 32.096378,4.5726641 59.163597,0.4891005 54.680408,57.805097 32.096378,63.510899 8.3116209,57.805097 z"
style="fill:#e5e7e8;fill-opacity:1;fill-rule:nonzero;stroke:#cccccc" />
<path
d="M 32.096378,10.745857 53.925414,6.8301117 51.016574,53.81906 32.096378,58.517955 z"
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<rect
width="34.027256"
height="19.136194"
x="3.7557135"
y="22.431904"
style="fill:#ff2600;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<rect
width="23.480518"
height="19.136194"
x="36.763767"
y="22.431904"
style="fill:#ff501a;fill-opacity:1;fill-rule:nonzero;stroke:none" />
<g transform="matrix(0.42778543,0,0,0.42778543,58.617711,9.6737064)">
<path
d="m -120.53125,34.59375 0,35.1875 6.53125,0 0,-5.9375 0,-5.96875 8.875,0 4.15625,-3.71875 0,-7.71875 0,-7.71875 -4.21875,-4.125 -15.34375,0 z m 6.53125,6.8125 6.21875,0 0,10.21875 -6.21875,0 0,-10.21875 z"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m -98.125,34.59375 0,35.1875 16.125,0 3.75,-3.625 0,-27.96875 -3.96875,-3.59375 -15.90625,0 z m 6.8125,6.8125 6.8125,0 0,21.5625 -6.8125,0 0,-21.5625 z" id="path3056"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m -74.856072,34.602929 c 5.485697,0 10.971394,0 16.457091,0 0,2.269943 0,4.539887 0,6.80983 -3.404915,0 -6.809831,0 -10.214746,0 0,2.472069 0,4.944138 0,7.416206 2.93201,0.110496 5.864021,-0.110494 8.796031,0 l 0,3.366025 0,3.375914 c -2.93201,0.110495 -5.864021,-0.110495 -8.796031,0 l 0,7.146446 0,7.069702 c -2.080782,0 -4.161563,0 -6.242345,0 0,-11.728041 0,-23.456082 0,-35.184123 z"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m -42.8813,67.942723 -2.181762,-1.844329 c 0,-1.986871 0,-3.973742 0,-5.960613 2.175363,6.7e-4 4.350725,0.0013 6.526088,0.002 0,0.94581 0,1.891619 0,2.837429 1.891619,0 3.783239,0 5.674858,0 0,-9.458098 0,-18.916195 0,-28.374293 2.175363,-1.26e-4 4.350725,-2.52e-4 6.526088,-3.78e-4 0,10.498614 0,20.997229 0,31.495843 -1.454508,1.229554 -2.909019,2.459106 -4.363529,3.688658 -3.333325,0 -6.666651,0 -9.999976,0 -0.727237,-0.614768 -1.454563,-1.229595 -2.181767,-1.844308 z"
style="fill:#ffffff;fill-opacity:1" />
<path
d="m -21.316836,67.942723 -2.109122,-1.844329 0,-5.978379 c 2.061011,0 4.392437,0.01978 6.453448,0.01978 0,0.94581 0,1.891619 0,2.837429 2.269943,0 4.539887,0 6.80983,0 0,-2.459105 0,-4.918211 0,-7.377316 -3.196954,0 -6.393909,0 -9.590863,0 l -3.745055,-3.688659 0,-6.80983 0,-6.80983 3.745055,-3.688658 c 3.863156,0 7.726313,0 11.5894692,0 l 4.2511106,3.688658 c -0.00204,1.797039 -0.00472,3.594077 -0.00737,5.391115 -2.0807816,0 -4.1615632,0 -6.2423448,0 0,-0.756648 0,-1.513295 0,-2.269943 -2.269943,0 -4.539887,0 -6.80983,0 0,2.459105 0,4.918211 0,7.377316 2.990126,0 5.980253,0 8.9703792,0 1.3605964,1.204585 4.0817956,3.613749 4.0817956,3.613749 0,4.555246 0,9.110492 0,13.665738 l -2.0892845,1.858745 -2.0892901,1.858745 -5.5180792,0 -5.51808,0 z"
style="fill:#ffffff;fill-opacity:1" />
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path d="M4.836.49l27.26 4.083L59.164.49 54.68 57.804 32.096 63.51 8.312 57.806z" fill="#e5e7e8" stroke="#ccc"/><path d="M32.096 10.746l21.83-3.916-2.91 46.99-18.92 4.698z" fill="#fff"/><path fill="#ff2600" d="M3.756 22.432h34.027v19.136H3.756z"/><path fill="#ff501a" d="M36.764 22.432h23.48v19.136h-23.48z"/><path d="M7.056 24.472v15.053H9.85v-5.093h3.797l1.778-1.59v-6.606L13.62 24.47H7.056zm2.794 2.915h2.66v4.37H9.85v-4.37zm6.79-2.915v15.053h6.9l1.604-1.55V26.01l-1.698-1.538H16.64zm2.916 2.915h2.914v9.224h-2.914v-9.22zm7.04-2.91h7.04v2.912h-4.37v3.17c1.254.046 2.51-.048 3.763 0v2.883c-1.26.047-2.51-.047-3.767 0v6.082h-2.67v-15.05zM40.273 38.74l-.934-.79V35.4h2.79v1.214h2.43V24.476h2.79V37.95l-1.867 1.578h-4.278l-.933-.79zm9.226 0l-.906-.79v-2.558c.882 0 1.88.01 2.76.01v1.212h2.914V33.46h-4.104l-1.602-1.58v-5.826l1.602-1.578h4.958l1.82 1.578-.004 2.307h-2.67v-.97h-2.91v3.158h3.838l1.746 1.546v5.847l-.893.795-.895.796h-4.72z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 430 B

@ -1,5 +1,7 @@
'use strict';
(function(win) {
var exports = {};
(function(exports) {
@ -76,6 +78,7 @@ var exports = {};
},
SCRIPT_IN_WINDOW_TOP: window === window.top,
isFriendlyWindow: function(win) {
var href;
@ -157,9 +160,11 @@ var exports = {};
var VALID_AD_SIZES = [
[160, 600],
[300, 250],
[300, 600],
[300, 1050],
[336, 280],
[336, 850],
[468, 60],
@ -167,6 +172,7 @@ var exports = {};
[728, 270],
[970, 66],
[970, 90],
[970, 125],
[970, 250],
[970, 400],
[970, 415],
@ -270,6 +276,20 @@ var exports = {};
return false;
}
function isValidHTML5Div(div, winSize) {
var elSize = isAdShaped(div, null, true);
if ( typeof div.checks !== 'number' ) {
div.checks = 1;
} else {
div.checks += 1;
}
return (elSize &&
elSize[0] === winSize[0] && elSize[1] === winSize[1] &&
div.checks > 1);
}
var HTML5_SIGNAL_ELEMENTS = 'canvas, button, video, svg, img';
function iframeGetHTMLAd(win) {
var body = win.document.body,
@ -305,7 +325,7 @@ var exports = {};
for ( i = 0; i < divs.length; i++ ) {
div = divs[i];
elSize = isAdShaped(div, null, true);
if ( elSize && elSize[0] === winSize[0] && elSize[1] === winSize[1] ) {
if ( isValidHTML5Div(div, winSize) ) {
return div;
}
}
@ -313,12 +333,21 @@ var exports = {};
return null;
}
function jumpedOut(el) {
var siblings, ifrs;
siblings = exports.utils.realArray(el.parentNode.children);
ifrs = siblings.filter(function(el) {
return el.tagName === 'IFRAME' && el.offsetWidth === 0 && el.offsetHeight === 0;
});
return ifrs.length > 0;
}
function mainGetHTMLAd(win) {
var styles = win.document.querySelectorAll('div > style, div > link[rel="stylesheet"]'),
i, div;
for ( i = 0; i < styles.length; i++ ) {
div = styles[i].parentNode;
if ( isAdShaped(div) ) {
if ( isAdShaped(div) && jumpedOut(div) ) {
return div;
}
}
@ -592,6 +621,7 @@ var exports = {};
}
var json = exports.parser.elementToJSON(el, elIsAd);
var childJSON;
if ( elIsAd ) {
json.adId = adId;
@ -614,7 +644,10 @@ var exports = {};
});
for ( i = 0; i < children.length; i++ ) {
json.children.push(this.serializeElements(children[i]));
childJSON = this.serializeElements(children[i]);
if ( childJSON ) {
json.children.push(childJSON);
}
}
if ( el.tagName === 'IFRAME' ) {
@ -628,11 +661,18 @@ var exports = {};
} else if ( exports.utils.isFriendlyWindow(ifrWin) ) {
json.contents = this.serializeElements(ifrWin.document.documentElement);
childJSON = this.serializeElements(ifrWin.document.documentElement);
if ( childJSON ) {
json.contents = childJSON;
}
}
}
if ( json.children.length > 0 || json.adId || json.tagName === 'IFRAME' || json.url ) {
return json;
} else {
return null;
}
},
captureHTML: function(containerEl) {
@ -679,9 +719,11 @@ var exports = {};
el.left += winPos.left;
el.top += winPos.top;
if ( el.children ) {
el.children.forEach(function(child) {
this.setPositions(adData, child, winPos);
}, this);
}
if ( el.contents ) {
ifrPos = {left: el.left, top: el.top};
@ -703,7 +745,7 @@ var exports = {};
highestContainer = mgr.highestContainer(curWin, referenceElement);
mgr.captureHTML(highestContainer);
if ( curWin === window.top ) {
if ( curWin === curWin.top ) {
break;
} else {
mgr.adData.serializedIframeContents = mgr.adData.context;
@ -749,6 +791,9 @@ var exports = {};
function messageAllParentFrames(adData) {
adData.dummyId = true;
adData = JSON.stringify(adData);
var win = window;
while ( win !== win.top ) {
win = win.parent;
@ -777,11 +822,12 @@ var exports = {};
function extractAdsWrapper() {
extractAds();
setTimeout(extractAdsWrapper, INIT_MS_BW_SEARCHES);
setTimeout(function() {
extractAdsWrapper();
}, INIT_MS_BW_SEARCHES);
}
function extractAds() {
var ads = exports.adfinder.findAds(window);
if ( !ads ) {
@ -798,9 +844,7 @@ var exports = {};
height: ad.offsetHeight,
startTime: startTime,
adId: adId,
html5: ad.html5 || false,
inIframe: ad.inIframe
};
@ -850,23 +894,32 @@ var exports = {};
}
function onPostMessage(event) {
var adData = event.data,
var adData,
ifrWin = event.source,
myWin = window.document.defaultView,
ifrTag;
try {
adData = JSON.parse(event.data);
} catch(e) {
return;
}
if ( adData.dummyId ) {
delete adData.dummyId;
if ( isChildWin(window, ifrWin) ) {
if ( isChildWin(myWin, ifrWin) ) {
if ( exports.utils.isFriendlyWindow(ifrWin) ) {
ifrTag = ifrWin.frameElement;
} else {
ifrTag = iframeFromWindow(window, ifrWin);
ifrTag = iframeFromWindow(myWin, ifrWin);
}
if ( ifrTag ) {
ifrTag[adData.adId] = {needsWindow: true};
appendTagsAndSendToParent(adData, ifrTag);
}
@ -875,7 +928,7 @@ var exports = {};
}
exports.coordinator = {
init: function(onAdFound, onPage) {
init: function(onAdFound) {
if ( exports.utils.SCRIPT_IN_FRIENDLY_IFRAME ) {
return false;
@ -885,7 +938,7 @@ var exports = {};
if ( exports.utils.SCRIPT_IN_WINDOW_TOP ) {
var log = _logGen.log('page');
onPage(log);
onAdFound(log);
}
window.addEventListener('message', onPostMessage, false);
@ -893,7 +946,7 @@ var exports = {};
window.addEventListener('beforeunload', function(event) {
var log = _logGen.log('unload');
log.timing = window.performance.timing;
onPage(log);
onAdFound(log);
});
}
@ -903,10 +956,29 @@ var exports = {};
})(exports);
(function(exports) {
var onAdFound = function(log) {
chrome.extension.sendRequest({ id: 'ad_log', subject: log });
if ( exports.utils.SCRIPT_IN_WINDOW_TOP ) {
window.adparser = {
init: exports.coordinator.init,
};
} else {
exports.coordinator.init(function() {});
}
exports.coordinator.init(onAdFound, onAdFound);
})(exports);
})(window);
(function(adparser) {
function sendToBackground(event, message) {
if ( window.self.port ) {
window.self.port.emit(event, message);
} else if ( typeof chrome !== 'undefined' ) {
chrome.extension.sendRequest(message);
}
}
function onAdFound(log) {
sendToBackground('ad_log', { id: 'ad_log', subject: log });
}
if ( window === window.top ) {
adparser.init(onAdFound);
}
})(window.adparser);
Loading…
Cancel
Save