unknow

Từ điển unit8.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

Advertisement:

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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!