unknow

Từ điển unit8.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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!