CW AdBlocker

Instantly nukes pause ads, redirects alt domains to .tv

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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);
})();