metafox12345gmail.com / Fuck JAVMost

// ==UserScript==
// @name         Fuck JAVMost
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  try to take over the world!
// @author       metafox12345
// @match        https://*.javmost.com/star/*
// @match        https://*.javmost.com/category/*
// @match        https://*.javmost.com/maker/*
// @match        https://*.javmost.com/search/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    window.getValFromCookieOrLocalStorage = () => "";
    // Fuck setInterval
    window.____originalSetInterval = window.setInterval;
    window.setInterval = (callback, delay, ...params) => {
        // Fuck this
        if (callback.toString().includes("_0x")) {
            console.log("⚔ Fucked one setInterval. Here is the callback source code:");
            console.log(callback.toString());
        } else {
            return window.____originalSetInterval(callback, delay, ...params);
        }
    }
    function killAds() {
        requestIdleCallback(() => {
            const cards = document.querySelectorAll('.card');
            for (const card of cards) {
                const adLinks = [...card.querySelectorAll('a[alt]')].filter(x => {
                    // JAV identifier
                    const alt = x.getAttribute('alt');
                    return /[a-zA-Z]+\-\d+/.exec(alt) != null && !x.href.endsWith(alt);
                });
                for (const link of adLinks) {
                    link.href = document.location.origin + '/' + link.getAttribute('alt');
                    console.log('🗡 [Fuck JAVMost] Killed one ad');
                }
            }
        });
    }
    if (/^(\/star\/|\/category\/|\/maker\/|\/search\/)/.test(window.location.pathname)) {
        killAds();

        const observer = new MutationObserver(() => {
            console.log('🗡 [Fuck JAVMost] Observed DOM mutation.')
            killAds();
        });
        observer.observe(document.querySelector('#content-update'), {
            childList: true,
        });
    }
})();