unknow

Từ điển unit8.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

// ==UserScript==
// @name         unknow
// @namespace    http://tampermonkey.net/
// @version      16.0
// @description  Từ điển unit8.
// @author       Trần Bảo Ngọc
// @match        *://vstep.tnu.edu.vn*/*
// @grant        none
// ==/UserScript==
// ===== ANTI-DETECTION (BẢN HOÀN CHỈNH) =====
(() => {
    'use strict';

    // 1. Danh sách từ khóa cần chặn
    const BL = ['playerExited','playerResumed','infractionType','extensionDetected','windowResizeDetected','rightClickDetected','pasteDetected'];
    const block = s => typeof s === 'string' && BL.some(k => s.includes(k));
    const fakeRes = () => new Response('{"success":true}', { status: 200 });
    
    // 2. Chặn Fetch API
    const _fetch = fetch;
    window.fetch = async function(...a) {
        return a[1]?.body && block(a[1].body) ? fakeRes() : _fetch.apply(this, a);
    };

    // 3. Chặn XMLHttpRequest
    const _xhr = XMLHttpRequest.prototype.send;
    XMLHttpRequest.prototype.send = function(b) {
        if (block(b)) {
            Object.defineProperties(this, { 
                readyState: { value: 4, configurable: true }, 
                status: { value: 200, configurable: true } 
            });
            this.onreadystatechange?.();
            return;
        }
        _xhr.apply(this, arguments);
    };

    // 4. Sửa dữ liệu JSON (đánh lừa trạng thái ứng dụng)
    const _parse = JSON.parse;
    JSON.parse = function(...a) {
        const r = _parse.apply(this, a);
        if (r?.type === 'RN_APP_STATE_CHANGE' && r.value === 'background') {
            r.value = 'foreground';
        }
        return r;
    };

    // 5. Chặn các sự kiện rời trang
    const stop = e => e.stopImmediatePropagation();
    const eventsToBlock = ['visibilitychange','blur','mouseleave','pagehide','resize','contextmenu','copy','paste'];
    for (const ev of eventsToBlock) {
        [window, document].forEach(t => t.addEventListener(ev, stop, true));
    }

    // 6. Ép trình duyệt luôn báo cáo trạng thái "Đang hiển thị"
    const safeDef = (o, p, v) => {
        try { 
            if (Object.getOwnPropertyDescriptor(o, p)?.configurable !== false) {
                Object.defineProperty(o, p, { get: () => v, configurable: true }); 
            }
        } catch (e) {}
    };

    for (const o of [Document.prototype, document]) { 
        safeDef(o, 'visibilityState', 'visible'); 
        safeDef(o, 'hidden', false); 
    }
    
    window.onblur = document.onblur = null;
    document.hasFocus = () => true;

})(); // <-- Lỗi của bạn thường nằm ở việc copy thiếu dòng đóng hàm này!