Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- const keywords = ['pricy-', 'xprice-', 'pretzi-', 'istoricPreturi-'];
- const buildAllSelectors = function() {
- return keywords.flatMap(function(k) {
- return ['[id*="' + k + '"]', '[class*="' + k + '"]', '[data-id*="' + k + '"]'];
- }).join(',');
- };
- const isMatch = function(node) {
- if (node.nodeType !== 1) return false;
- const fp = [node.id || '', node.className || '', node.getAttribute('data-id') || ''].join('|');
- return keywords.some(function(k) { return fp.includes(k); });
- };
- const handleNode = function(node) {
- if (isMatch(node)) {
- node.remove();
- } else {
- Array.from(node.querySelectorAll('*')).forEach(function(child) {
- if (isMatch(child)) child.remove();
- });
- }
- };
- // Metoda 1: MutationObserver — sterge <1ms de la injectare
- const observer = new MutationObserver(function(mutations) {
- mutations.forEach(function(m) {
- Array.from(m.addedNodes || []).forEach(handleNode);
- });
- });
- observer.observe(document.body, { childList: true, subtree: true, attributes: true });
- // Metoda 2: sweep la fiecare 2 secunde
- setInterval(function() {
- document.querySelectorAll(buildAllSelectors()).forEach(function(n) { n.remove(); });
- }, 2000);
- // Metoda 3: CSS injection
- const style = document.createElement('style');
- style.textContent = buildAllSelectors() + ' { display: none !important; visibility: hidden !important; }';
- document.head.appendChild(style);
- })();
Advertisement
Add Comment
Please, Sign In to add comment