Created
July 24, 2024 19:43
-
-
Save tekwiz/7a1dcfd84fa4eacdbac3804e48c9e2aa to your computer and use it in GitHub Desktop.
Log messages sent/received
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
window.addEventListener('message', function MessageLogger (o) { | |
console.debug('Message Origin:%s Data:%o', o.origin, o.data); | |
}); | |
window.__postMessage = Window.prototype.postMessage; | |
Window.prototype.postMessage = function _postMessage () { | |
console.debug('PostMessage %o', Array.from(arguments)); | |
window.__postMessage.apply(this, arguments); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment