(function () {
while (typeof ethereum ==="undefined"){
var hook1 = ethereum;
const ethereum = function () {
hook1(...arguments);
};
window.ethereum = ethereum;
Object.defineProperty(window, "ethereum", {
value: ethereum,
writable: false,
configurable: false,
});
}
})();
(function () {
var hook2 = window.postMessage;
const postMessage = function (message, targetOrigin, transfer) {
hook2.call(this, message, targetOrigin, transfer,);
};
// 将 postMessage 赋值给 window 对象
window.postMessage = postMessage;
// 将 postMessage 声明为 const 类型的对象
Object.defineProperty(window, "postMessage", {
value: postMessage,
writable: false,
configurable: false,
});
})();