Created
May 15, 2020 13:56
-
-
Save Toxiapo/267f50466c25f12d3f339cd224774d9f to your computer and use it in GitHub Desktop.
Monitor Text node change
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
var textNode = document.querySelector("$SELECTOR"); | |
textNode.addEventListener("DOMCharacterDataModified", action, false); | |
function action(evt) { | |
if($CONDITION) { | |
window.open("http://www.google.com", "test" ,"modal=yes"); | |
window.focus(); | |
textNode.removeEventListener("DOMCharacterDataModified", action, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment