Pornhub Ultra Ad Blocker

Tüm reklamları engeller (banner, pop-up, video pre-roll, Trafficky) ve header'ı korur

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Pornhub Ultra Ad Blocker
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Tüm reklamları engeller (banner, pop-up, video pre-roll, Trafficky) ve header'ı korur
// @author       Volkan
// @match        https://www.pornhub.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Reklamları silme fonksiyonu
    function removeAds() {
        // Standart banner, iframe ve container reklamlar
        document.querySelectorAll(
            '#ph-main-ad, .ad-container, .ads, iframe[src*="ads"], .adBanner'
        ).forEach(el => {
            if (!el.closest('header')) el.remove();
        });

        // Overlay ve pop-up reklamlar
        document.querySelectorAll('.overlayAd, .popupAd, .popUp').forEach(el => el.remove());

        // Trafficky ve karmaşık rastgele reklam containerları
        document.querySelectorAll(
            '.tj-inban-container, .bddfnhclec1756647663941, .dfgfgbccfe'
        ).forEach(el => {
            if (!el.closest('header')) el.remove();
        });

        // Rastgele ID’li Trafficky benzeri reklamlar
        document.querySelectorAll('div[id^="b"]').forEach(el => {
            if (el.querySelector('.tj-inban-icon, iframe[src*="traffic"]')) {
                if (!el.closest('header')) el.remove();
            }
        });
    }

    // Sayfa yüklemesinde çalıştır
    removeAds();

    // Dinamik reklam eklemelerini izle
    const observer = new MutationObserver(() => removeAds());
    observer.observe(document.body, { childList: true, subtree: true });

    // Video pre-roll reklamları atlamak
    const skipAdsInterval = setInterval(() => {
        const skipBtn = document.querySelector('.videoAdUiSkipButton');
        if(skipBtn) skipBtn.click();
    }, 1000);

    // WebSocket üzerinden gelen gizli reklam verilerini engelle
    const originalWebSocket = window.WebSocket;
    window.WebSocket = function(url, protocols) {
        const socket = new originalWebSocket(url, protocols);
        const originalSend = socket.send;
        socket.send = function(data) {
            if (data && data.includes && data.includes('ad')) {
                console.log('Reklam verisi engellendi:', data);
                return;
            }
            originalSend.apply(socket, arguments);
        };
        return socket;
    };
})();