unknow

Từ điển unit8.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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!