Blocks advertisements and popups on powerppshtraff.digital
Size
3.4 KB
Version
1.0.1
Created
Oct 25, 2025
Updated
3 months ago
1// ==UserScript==
2// @name Ad Blocker for Powerppshtraff
3// @description Blocks advertisements and popups on powerppshtraff.digital
4// @version 1.0.1
5// @match https://*.click.powerppshtraff.digital/*
6// ==/UserScript==
7(function() {
8 'use strict';
9
10 console.log('Ad Blocker initialized');
11
12 // Function to remove ads
13 function removeAds() {
14 // Common ad selectors
15 const adSelectors = [
16 'iframe[src*="ad"]',
17 'iframe[src*="ads"]',
18 'iframe[src*="doubleclick"]',
19 'iframe[src*="googlesyndication"]',
20 'div[class*="ad-"]',
21 'div[class*="ads-"]',
22 'div[id*="ad-"]',
23 'div[id*="ads-"]',
24 'div[class*="advertisement"]',
25 'div[id*="advertisement"]',
26 'div[class*="banner"]',
27 'div[id*="banner"]',
28 'div[class*="popup"]',
29 'div[id*="popup"]',
30 'div[class*="overlay"]',
31 'ins.adsbygoogle',
32 '[data-ad-slot]',
33 '[data-ad-client]',
34 'a[href*="click."]',
35 'a[href*="tracker"]',
36 'a[href*="redirect"]'
37 ];
38
39 let removedCount = 0;
40
41 adSelectors.forEach(selector => {
42 const elements = document.querySelectorAll(selector);
43 elements.forEach(element => {
44 element.remove();
45 removedCount++;
46 });
47 });
48
49 if (removedCount > 0) {
50 console.log(`Removed ${removedCount} ad elements`);
51 }
52 }
53
54 // Block popups and new windows
55 const originalOpen = window.open;
56 window.open = function() {
57 console.log('Blocked popup attempt');
58 return null;
59 };
60
61 // Block common ad scripts
62 const blockScript = function(src) {
63 const adDomains = [
64 'doubleclick.net',
65 'googlesyndication.com',
66 'googleadservices.com',
67 'google-analytics.com',
68 'googletagmanager.com',
69 'facebook.net',
70 'ads',
71 'adservice',
72 'advertising'
73 ];
74
75 return adDomains.some(domain => src && src.includes(domain));
76 };
77
78 // Observe and block dynamically added scripts
79 const observer = new MutationObserver(function(mutations) {
80 mutations.forEach(function(mutation) {
81 mutation.addedNodes.forEach(function(node) {
82 if (node.tagName === 'SCRIPT' && blockScript(node.src)) {
83 node.remove();
84 console.log('Blocked ad script:', node.src);
85 }
86 if (node.tagName === 'IFRAME' && blockScript(node.src)) {
87 node.remove();
88 console.log('Blocked ad iframe:', node.src);
89 }
90 });
91 });
92 removeAds();
93 });
94
95 // Initialize
96 function init() {
97 // Remove existing ads
98 removeAds();
99
100 // Start observing for new ads
101 if (document.body) {
102 observer.observe(document.body, {
103 childList: true,
104 subtree: true
105 });
106 }
107
108 // Periodically check for ads
109 setInterval(removeAds, 2000);
110
111 console.log('Ad Blocker active');
112 }
113
114 // Run when page loads
115 if (document.readyState === 'loading') {
116 document.addEventListener('DOMContentLoaded', init);
117 } else {
118 init();
119 }
120
121})();