Last active
March 26, 2024 04:56
-
-
Save sunfkny/3c225d4f0fd8638719ff4ae61eb7d4a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const oldAddEventListener = document.body.addEventListener; | |
const events = ["mouseenter", "mouseleave"] | |
unsafeWindow.bodyListeners = {} | |
document.body.addEventListener = function (event, listener, options) { | |
if (events.includes(event)) { | |
if(unsafeWindow.bodyListeners[event]){ | |
console.warn("[修复重复卡片请求]", event, unsafeWindow.bodyListeners) | |
document.body.removeEventListener(event, unsafeWindow.bodyListeners[event], options) | |
} | |
unsafeWindow.bodyListeners[event] = listener | |
} | |
return oldAddEventListener.apply(this, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment