Created
January 21, 2022 07:28
-
-
Save NaClYen/f41fcb2519d72f805ea554eed209db1e to your computer and use it in GitHub Desktop.
restore console log/warn/error/trace ...etc in chrome
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
// 概念就是導向新的 iframe 裡面去, 金夭壽XDD | |
// https://stackoverflow.com/a/7089553/6573523 | |
var i = document.createElement('iframe'); | |
i.style.display = 'none'; | |
document.body.appendChild(i); | |
window.console = i.contentWindow.console; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment