unknow

Từ điển unit8.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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!