js_reverse/zy-补环境框架/window_proxy.js
2022-03-22 18:01:37 +08:00

19 lines
519 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

window = this;
// 后代理的检测不到先代理
window = new Proxy(window, {
set(obj, prop, value) {
// obj 那个对象, prop哪个属性value设置的值
console.log(obj, prop, value);
return Reflect.set(...arguments);
},
get: function (target, property, receiver) {
// obj 那个对象, prop哪个属性value设置的值
console.log(target, property, receiver);
return target[property];
}
});
window.ayf = 123;
window.aaa = window.ayf;