Bypass CDP Detection

2025/3/23 14:17:37

目前為 2025-03-23 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Bypass CDP Detection
// @namespace   http://fulicat.com
// @author      Jack.Chan ([email protected])
// @version     1.0.1
// @run-at      document-start
// @match       *://*/*
// @match       file:///*
// @url         https://gf.qytechs.cn/zh-CN/scripts/530590-bypass-cdp-detection
// @grant       none
// @description 2025/3/23 14:17:37
// @license MIT
// ==/UserScript==





;(function() {
    var originalError = Error;

    // Lock down the stack property on Error.prototype to prevent modification
    Object.defineProperty(Error.prototype, 'stack', {
        configurable: false,
        enumerable: true,
        writable: false,
        value: (function() {
            try {
                throw new originalError();
            } catch (e) {
                return e.stack;
            }
        })()
    });

    // Proxy the Error constructor to prevent any instance-specific stack modifications
    window.Error = new Proxy(originalError, {
        construct(target, args) {
            var instance = new target(...args);

            // Freeze the instance to prevent any modifications
            return Object.freeze(instance);
        }

    });

  	// Override Object.defineProperty
  	var originalObjectDefineProperty = Object.defineProperty;
	Object.defineProperty = function defineProperty(obj, prop, descriptor) {
		if (prop !== 'stack') {
			return originalObjectDefineProperty.apply(Object, arguments);
		} else {
			console.log('// CDP bypass [Object.defineProperty]', String.fromCharCode(10), 'obj:', obj, String.fromCharCode(10), 'prop:', prop, String.fromCharCode(10), 'descriptor:', descriptor, String.fromCharCode(10), String.fromCharCode(10), String.fromCharCode(10) );
		}
		return {};
	}
	Object.defineProperty.toString = function toString() {
		return originalObjectDefineProperty.toString();
	};

    // alert('bypass_CDP_detection injected');
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址