Anti Devtools Detector

Blocks loading of JavaScript files containing "devtools" or "test" in their names

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Anti Devtools Detector
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Blocks loading of JavaScript files containing "devtools" or "test" in their names
// @author       Your name
// @match        *://*/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Intercept requests and block those containing "devtools" or "test" in their names
    const originalFetch = window.fetch;
    window.fetch = function(resource, init) {
        const url = resource instanceof Request ? resource.url : resource;
        if (url.includes("devtools") || url.includes("test")) {
            console.log("Blocked request:", url);
            return new Promise((resolve, reject) => {
                reject(new Error("Blocked by Tampermonkey"));
            });
        } else {
            return originalFetch.apply(this, arguments);
        }
    };
})();