Chrome | 112.0.0 | own | function | function getBlockedReason(elem, src, method, details) {
src ??= elem.src;
// if (src?.includes('dstat')) debugger;
let reason = elem.dataset?.blockedSrc ? 'blockedSrc'
: src?.toString().startsWith('data:image') ? null
: elem.tagName == 'VIDEO' && !dontTouch.VIDEO ? 'VIDEO'
: elem.tagName == 'VIDEO' && dontTouch.VIDEO ? null
: /IFRAME|SCRIPT/.test(elem.tagName) && elem.style?.visibility == 'hidden' ? 'visibility:hidden'
: elem.tagName == 'IFRAME' && shouldBlockFrame(elem, src)
|| elem.tagName == 'IMAGE' && src?.match(/dstat|\.gif\?/)?.[0]
|| ('' + elem.id + elem.className).match(/apiary-timer|apiary-marker|adfox_feed/)
|| shouldBlockThirdParty(src)
|| !dontTouch.blackScripts && ('' + elem.src + elem.dataset?.blockedSrc).match(blackScripts)
|| elem.tagName == 'SCRIPT' && elem.textContent?.match(preventedKeywords)
|| src?.toString().match(blackScripts)?.[0]
let savedInfo = {
src: src || elem.href || elem.textContent,
className: elem.className || elem.id || elem.rel || elem.wholeText,
elem,
stack: dontTouch.$_SaveStack && new Error().stack.split('\n ').slice(3),
reason,
};
if (dontTouch.$_SaveChilds && reason) ((BLOCKED[method] ??= {})[(reason ? "❎ " : "✔️ ") + elem.tagName] ??= []).push(savedInfo);
return reason;
} |