Fixed iframe.js issues

main
Elbert Alias 9 years ago
parent c7c8e57e2e
commit 3a26550dbb

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
{ "name": "Wappalyzer", { "name": "Wappalyzer",
"homepage_url": "https://wappalyzer.com?pk_campaign=chrome&pk_kwd=context", "homepage_url": "https://wappalyzer.com?pk_campaign=chrome&pk_kwd=context",
"description": "Identifies software on the web", "description": "Identifies software on the web",
"version": "2.43", "version": "2.44",
"default_locale": "en", "default_locale": "en",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {

@ -1 +1 @@
<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> <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.042 2.51-.05 3.763 0v2.88c-1.26.046-2.51-.048-3.77 0v6.08h-2.67V24.47zM40.273 38.74l-.934-.79V35.4h2.79v1.214h2.43V24.476h2.79V37.95l-1.87 1.578H41.2l-.933-.79zm9.226 0l-.91-.79v-2.558c.882 0 1.88.01 2.76.01v1.212h2.914V33.46H50.16l-1.6-1.58v-5.826l1.602-1.578h4.958l1.82 1.578-.002 2.307h-2.67v-.97h-2.91v3.16h3.838l1.746 1.548v5.847l-.892.795-.895.795h-4.72z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 1007 B

@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="16px" height="16px" viewbox="0 0 16 16"><rect x="9" y="9" width="7" height="7" fill="#14B1EF"/><rect x="1" y="9" width="7" height="7" fill="#A7C721"/><rect x="5" y="1" width="7" height="7" fill="#F7A12B"/></svg> <svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="16" height="16"><path fill="#14B1EF" d="M9 9h7v7H9z"/><path fill="#A7C721" d="M1 9h7v7H1z"/><path fill="#F7A12B" d="M5 1h7v7H5z"/></svg>

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 216 B

@ -32,7 +32,7 @@ var exports = {};
result = a.protocol + '//' + a.hostname + '/'; result = a.protocol + '//' + a.hostname + '/';
if ( a.pathname !== '/' ) { if ( a.pathname && a.pathname !== '/' ) {
result += this.hashCode(a.pathname); result += this.hashCode(a.pathname);
} }
@ -68,7 +68,6 @@ var exports = {};
realArray: function(a) { realArray: function(a) {
return Array.prototype.slice.apply(a); return Array.prototype.slice.apply(a);
}, },
onDocLoaded: function(doc, callback) { onDocLoaded: function(doc, callback) {
if ( doc.readyState === 'loading' ) { if ( doc.readyState === 'loading' ) {
doc.addEventListener('DOMContentLoaded', callback); doc.addEventListener('DOMContentLoaded', callback);
@ -222,12 +221,7 @@ var exports = {};
var isImgWithoutSrc = el.tagName === 'IMG' && !el.src; var isImgWithoutSrc = el.tagName === 'IMG' && !el.src;
var isImgWithoutAnchor = el.tagName === 'IMG' && !(el.parentNode.tagName === 'A' || el.getAttribute('onclick')); var isImgWithoutAnchor = el.tagName === 'IMG' && !(el.parentNode.tagName === 'A' || el.getAttribute('onclick'));
return isAdShaped(el) && !isImgWithoutSrc && !isImgWithoutAnchor; return elementIsAdShaped(el) && !isImgWithoutSrc && !isImgWithoutAnchor;
}
function windowMightContainAds(win) {
return (win.innerWidth >= MIN_WINDOW_PX &&
win.innerHeight >= MIN_WINDOW_PX);
} }
function isNewAd(el, win) { function isNewAd(el, win) {
@ -243,24 +237,17 @@ var exports = {};
return friendlyIframes; return friendlyIframes;
} }
function isAdShaped(el, opt_win, opt_retMatched) { function getMatchedAdSize(width, height) {
var rect, width, height, result; return SIZE_SET[width + 'x' + height];
if ( opt_win ) {
width = opt_win.innerWidth;
height = opt_win.innerHeight;
} else {
rect = el.getBoundingClientRect();
width = rect.width;
height = rect.height;
} }
result = SIZE_SET[width + 'x' + height]; function elementIsAdShaped(el) {
if ( opt_retMatched ) { return !!getMatchedAdSizeForElement(el);
return result;
} else {
return !!result;
} }
function getMatchedAdSizeForElement(el) {
var rect = el.getBoundingClientRect();
return getMatchedAdSize(rect.width, rect.height);
} }
function containsLargeIframes(win) { function containsLargeIframes(win) {
@ -277,7 +264,7 @@ var exports = {};
} }
function isValidHTML5Div(div, winSize) { function isValidHTML5Div(div, winSize) {
var elSize = isAdShaped(div, null, true); var elSize = getMatchedAdSizeForElement(div);
if ( typeof div.checks !== 'number' ) { if ( typeof div.checks !== 'number' ) {
div.checks = 1; div.checks = 1;
@ -299,8 +286,8 @@ var exports = {};
if ( !body ) { if ( !body ) {
return null; return null;
} }
winSize = getMatchedAdSize(win.innerWidth, win.innerHeight);
winSize = isAdShaped(null, win, true);
if ( !winSize ) { if ( !winSize ) {
return null; return null;
} }
@ -309,7 +296,7 @@ var exports = {};
for ( i = 0; i < elements.length; i++ ) { for ( i = 0; i < elements.length; i++ ) {
el = elements[i]; el = elements[i];
elSize = isAdShaped(el, null, true); elSize = getMatchedAdSizeForElement(el);
if ( elSize && elSize[0] === winSize[0] && elSize[1] === winSize[1] ) { if ( elSize && elSize[0] === winSize[0] && elSize[1] === winSize[1] ) {
return el; return el;
} }
@ -324,7 +311,6 @@ var exports = {};
for ( i = 0; i < divs.length; i++ ) { for ( i = 0; i < divs.length; i++ ) {
div = divs[i]; div = divs[i];
elSize = isAdShaped(div, null, true);
if ( isValidHTML5Div(div, winSize) ) { if ( isValidHTML5Div(div, winSize) ) {
return div; return div;
} }
@ -347,16 +333,13 @@ var exports = {};
i, div; i, div;
for ( i = 0; i < styles.length; i++ ) { for ( i = 0; i < styles.length; i++ ) {
div = styles[i].parentNode; div = styles[i].parentNode;
if ( isAdShaped(div) && jumpedOut(div) ) { if ( elementIsAdShaped(div) && jumpedOut(div) ) {
return div; return div;
} }
} }
} }
function findAds(win, opt_ads) { function findAds(win, opt_ads) {
if ( !windowMightContainAds(win) ) {
return;
}
if ( typeof win.searches !== 'number' ) { if ( typeof win.searches !== 'number' ) {
win.searches = 0; win.searches = 0;
@ -365,6 +348,11 @@ var exports = {};
var ads = opt_ads || []; var ads = opt_ads || [];
var adsFound = 0; var adsFound = 0;
if ( win.innerWidth <= MIN_WINDOW_PX || win.innerHeight <= MIN_WINDOW_PX ) {
win.searches++;
return ads;
}
if ( exports.utils.SCRIPT_IN_WINDOW_TOP || win.searches < MAX_SEARCHES_PER_WINDOW ) { if ( exports.utils.SCRIPT_IN_WINDOW_TOP || win.searches < MAX_SEARCHES_PER_WINDOW ) {
var adCandidates = win.document.querySelectorAll('img, object, embed'); var adCandidates = win.document.querySelectorAll('img, object, embed');
adCandidates = exports.utils.realArray(adCandidates); adCandidates = exports.utils.realArray(adCandidates);
@ -417,7 +405,7 @@ var exports = {};
} }
exports.adfinder = { exports.adfinder = {
SIZE_SET: SIZE_SET, getMatchedAdSize: getMatchedAdSize,
findAds: findAds findAds: findAds
}; };
})(exports); })(exports);
@ -706,7 +694,7 @@ var exports = {};
var tagfinder = { var tagfinder = {
prepToSend: function(adData) { prepToSend: function(adData) {
adData.matchedSize = exports.adfinder.SIZE_SET[adData.width + 'x' + adData.height]; adData.matchedSize = exports.adfinder.getMatchedAdSize(adData.width, adData.height);
delete adData.width; delete adData.width;
delete adData.height; delete adData.height;
}, },
@ -821,7 +809,9 @@ var exports = {};
} }
function extractAdsWrapper() { function extractAdsWrapper() {
if ( exports.utils.SCRIPT_IN_WINDOW_TOP || document.readyState === 'complete' ) {
extractAds(); extractAds();
}
setTimeout(function() { setTimeout(function() {
extractAdsWrapper(); extractAdsWrapper();
}, INIT_MS_BW_SEARCHES); }, INIT_MS_BW_SEARCHES);

Loading…
Cancel
Save