| global.cursor_config = { |
| currentScriptSrc: "$$currentScriptSrc$$", |
| fp:{ |
| UNMASKED_VENDOR_WEBGL:"$$UNMASKED_VENDOR_WEBGL$$", |
| UNMASKED_RENDERER_WEBGL:"$$UNMASKED_RENDERER_WEBGL$$", |
| userAgent: "$$userAgent$$" |
| } |
| } |
|
|
| $$env_jscode$$ |
|
|
| let console_log = console.log; |
| console.log = function () { |
|
|
| } |
|
|
| dtavm = console; |
| delete __dirname; |
| delete __filename; |
|
|
| function proxy(obj, objname, type) { |
| function getMethodHandler(WatchName, target_obj) { |
| let methodhandler = { |
| apply(target, thisArg, argArray) { |
| if (this.target_obj) { |
| thisArg = this.target_obj |
| } |
| let result = Reflect.apply(target, thisArg, argArray) |
| if (target.name !== "toString") { |
| if (target.name === "addEventListener") { |
| dtavm.log(`调用者 => [${WatchName}] 函数名 => [${target.name}], 传参 => [${argArray[0]}], 结果 => [${result}].`) |
| } else if (WatchName === "window.console") { |
| } else { |
| dtavm.log(`调用者 => [${WatchName}] 函数名 => [${target.name}], 传参 => [${argArray}], 结果 => [${result}].`) |
| } |
| } else { |
| dtavm.log(`调用者 => [${WatchName}] 函数名 => [${target.name}], 传参 => [${argArray}], 结果 => [${result}].`) |
| } |
| return result |
| }, |
| construct(target, argArray, newTarget) { |
| var result = Reflect.construct(target, argArray, newTarget) |
| dtavm.log(`调用者 => [${WatchName}] 构造函数名 => [${target.name}], 传参 => [${argArray}], 结果 => [${(result)}].`) |
| return result; |
| } |
| } |
| methodhandler.target_obj = target_obj |
| return methodhandler |
| } |
|
|
| function getObjhandler(WatchName) { |
| let handler = { |
| get(target, propKey, receiver) { |
| let result = target[propKey] |
| if (result instanceof Object) { |
| if (typeof result === "function") { |
| dtavm.log(`调用者 => [${WatchName}] 获取属性名 => [${propKey}] , 是个函数`) |
| return new Proxy(result, getMethodHandler(WatchName, target)) |
| } else { |
| dtavm.log(`调用者 => [${WatchName}] 获取属性名 => [${propKey}], 结果 => [${(result)}]`); |
| } |
| return new Proxy(result, getObjhandler(`${WatchName}.${propKey}`)) |
| } |
| if (typeof (propKey) !== "symbol") { |
| dtavm.log(`调用者 => [${WatchName}] 获取属性名 => [${propKey?.description ?? propKey}], 结果 => [${result}]`); |
| } |
| return result; |
| }, |
| set(target, propKey, value, receiver) { |
| if (value instanceof Object) { |
| dtavm.log(`调用者 => [${WatchName}] 设置属性名 => [${propKey}], 值为 => [${(value)}]`); |
| } else { |
| dtavm.log(`调用者 => [${WatchName}] 设置属性名 => [${propKey}], 值为 => [${value}]`); |
| } |
| return Reflect.set(target, propKey, value, receiver); |
| }, |
| has(target, propKey) { |
| var result = Reflect.has(target, propKey); |
| dtavm.log(`针对in操作符的代理has=> [${WatchName}] 有无属性名 => [${propKey}], 结果 => [${result}]`) |
| return result; |
| }, |
| deleteProperty(target, propKey) { |
| var result = Reflect.deleteProperty(target, propKey); |
| dtavm.log(`拦截属性delete => [${WatchName}] 删除属性名 => [${propKey}], 结果 => [${result}]`) |
| return result; |
| }, |
| defineProperty(target, propKey, attributes) { |
| var result = Reflect.defineProperty(target, propKey, attributes); |
| dtavm.log(`拦截对象define操作 => [${WatchName}] 待检索属性名 => [${propKey.toString()}] 属性描述 => [${(attributes)}], 结果 => [${result}]`) |
| |
| return result |
| }, |
| getPrototypeOf(target) { |
| var result = Reflect.getPrototypeOf(target) |
| dtavm.log(`被代理的目标对象 => [${WatchName}] 代理结果 => [${(result)}]`) |
| return result; |
| }, |
| setPrototypeOf(target, proto) { |
| dtavm.log(`被拦截的目标对象 => [${WatchName}] 对象新原型==> [${(proto)}]`) |
| return Reflect.setPrototypeOf(target, proto); |
| }, |
| preventExtensions(target) { |
| dtavm.log(`方法用于设置preventExtensions => [${WatchName}] 防止扩展`) |
| return Reflect.preventExtensions(target); |
| }, |
| isExtensible(target) { |
| var result = Reflect.isExtensible(target) |
| dtavm.log(`拦截对对象的isExtensible() => [${WatchName}] isExtensible, 返回值==> [${result}]`) |
| return result; |
| }, |
| } |
| return handler; |
| } |
|
|
| if (type === "method") { |
| return new Proxy(obj, getMethodHandler(objname, obj)); |
| } |
| return new Proxy(obj, getObjhandler(objname)); |
| } |
|
|
| |
| global.document = window.document; |
|
|
| $$cursor_jscode$$ |
|
|
|
|
| window.V_C[0]().then(value => console_log(JSON.stringify(value))); |
|
|
|
|