Created
February 23, 2016 13:58
-
-
Save nexpr/fd7d47ff485da2a6fccc to your computer and use it in GitHub Desktop.
デバッグ用 innerHTML 監視
This file contains hidden or 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
| function monitorOverwriteInnerHTML(elem){ | |
| var desc = Object.getOwnPropertyDescriptor(Element.prototype, "innerHTML") | |
| Object.defineProperty(elem, "innerHTML", { | |
| get: function(){ | |
| return desc.get.call(this) | |
| }, | |
| set: function(x){ | |
| console.log(this, x) | |
| desc.set.call(this, x) | |
| } | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment