CW AdBlocker

Instantly nukes pause ads, redirects alt domains to .tv

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         CW AdBlocker
// @namespace    http://tampermonkey.net/
// @version      3.3
// @description  Instantly nukes pause ads, redirects alt domains to .tv
// @author       BlueAnivia
// @match        *://*.camwhores.tv/*
// @match        *://*.camwhores.in/*
// @match        *://*.camwhores.porn/*
// @match        *://*.camwhores.video/*
// @match        *://*.camwhores.rip/*
// @match        *://*.camwhores.cool/*
// @match        *://*.camwhores.film/*
// @match        *://*.camwhores.lol/*
// @match        *://*.camwhores.wtf/*
// @match        *://*.camwhores.biz/*
// @match        *://*.camwhores.tube/*
// @match        *://*.camwhores.dance/*
// @match        *://*.camwhores.com.co/*
// @match        *://*.camwhores.exposed/*
// @match        *://*.camwhores.camera/*
// @match        *://*.camwhores.works/*
// @match        *://*.camwhores.guru/*
// @match        *://*.camwhores.company/*
// @match        *://*.camwhores.media/*
// @match        *://*.camwhores.today/*
// @match        *://*.camwhores.fans/*
// @match        *://*.camwhores.club/*
// @match        *://*.camwhores.click/*
// @match        *://*.camwhores.digital/*
// @match        *://*.camwhores.studio/*
// @match        *://*.camwhores.pub/*
// @match        *://*.camwhores.ws/*
// @match        *://*.camwhores.boo/*
// @match        *://*.camwhores.art/*
// @match        *://*.camwhores.online/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=camwhores.tv
// @license      MIT
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const tldsToRedirect = [
        'in', 'porn', 'video', 'rip', 'cool', 'film', 'lol', 'wtf', 'biz', 'tube',
        'dance', 'com.co', 'exposed', 'camera', 'works', 'guru', 'company', 'media',
        'today', 'fans', 'club', 'click', 'digital', 'studio', 'pub', 'ws',
        'boo', 'art', 'online'
    ];

    const currentHost = window.location.hostname;

    for (let tld of tldsToRedirect) {
        if (currentHost.includes(`camwhores.${tld}`)) {
            const newURL = window.location.href.replace(`camwhores.${tld}`, 'camwhores.tv');
            window.location.replace(newURL);
            return;
        }
    }

    const injectCSS = () => {
        const style = document.createElement('style');
        style.textContent = `
            iframe[src*="cam4pays"], iframe[src*="clickadu"],
            a.fh-line, .fh-line1, .fh-line2, .fh-line3, .sponsor,
            .fp-ui-block, .fp-timeline-ad, .fp-time-left, .fp-ui-skip-ad,
            a[href*="vlmai1"], a[href*="clickadu"] {
                display: none !important;
                opacity: 0 !important;
                pointer-events: none !important;
                visibility: hidden !important;
                z-index: -2147483648 !important;
            }
        `;
        if (document.head) document.head.appendChild(style);
        else document.addEventListener('DOMContentLoaded', () => document.head.appendChild(style));
    };
    injectCSS();

    const nukeAds = () => {
        const skipButton = document.querySelector('.fp-ui-skip-ad');
        if (skipButton) skipButton.click();

        const stuckPlayer = document.querySelector('.is-ad-visible, .is-ad-paused');
        if (stuckPlayer) {
            const mainVideo = stuckPlayer.querySelector('video.fp-engine');
            if (mainVideo && mainVideo.paused) mainVideo.play().catch(() => {});
            stuckPlayer.classList.remove('is-ad-visible', 'is-ad-playing', 'is-ad-paused');
        }

        document.querySelectorAll('a[href*="vlmai1"], a[href*="clickadu"], script[src*="clickadu"]').forEach(el => el.remove());
    };

    const observer = new MutationObserver((mutations) => {
        let shouldNuke = false;

        for (let mutation of mutations) {
            if (mutation.addedNodes.length) {
                mutation.addedNodes.forEach(node => {
                    if (node.nodeType === 1) {
                        if (node.matches && node.matches('.fp-ui-block, .fp-ui-skip-ad, a[href*="vlmai1"]')) {
                            shouldNuke = true;
                        } else if (node.querySelector && node.querySelector('.fp-ui-skip-ad, .is-ad-visible')) {
                            shouldNuke = true;
                        }
                    }
                });
            }

            if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
                if (mutation.target.classList && mutation.target.classList.contains('is-ad-visible')) {
                    shouldNuke = true;
                }
            }
        }

        if (shouldNuke) nukeAds();
    });

    const startObserver = () => {
        if (document.body) {
            observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });
        } else {
            requestAnimationFrame(startObserver);
        }
    };
    startObserver();

    setInterval(nukeAds, 1000);
})();