www.serieturche.eu

03/11/2025, 15:33:16

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        www.serieturche.eu
// @namespace   https://github.com/GavinBrelstaff
// @match       https://www.serieturche.eu/*
// @grant       none
// @version     1.0
// @license         GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @description 03/11/2025, 15:33:16
// ==/UserScript==

// https://stackoverflow.com/a/76592599



window.count=0;

new MutationObserver(async (mutations, observer) => {
    const els = mutations
        .flatMap(e => [...e.addedNodes])
        .filter(e => e.tagName == 'SCRIPT')

    for( el of els )
    {
        window.count++;
        var safe = false;
        var str = '';
        if( el.src )
        {
            safe = ( !(el.hasAttribute('async')) &&
                       el.src.startsWith('https://www.serieturche.eu/wp-') )
            str = el.src;
        }
        else // inline code
        {
            str  = el.innerHTML.substring(0,40).replace(/\s*/g,'');
            safe = str.startsWith('(function($){$(document)')
                || str.startsWith('(vartimeout_result')
            ; // examine at script code
        }
        if( ! safe )
        {
           el.remove(); // kill script
           console.log( window.count + 'UNSAFE: ' + str );
        }
        else
           console.log( window.count + '  SAFE: ' + str );
    }

}).observe(document, {
    childList: true,
    subtree: true,
})