Created
July 28, 2018 12:10
-
-
Save m-hume/f07951207372426f9f94638c4c5f82ff to your computer and use it in GitHub Desktop.
Remove hotjar branding from feedback
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
(function() { | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function (mutation) { | |
var added = mutation.addedNodes; | |
for ( var node, i = added.length; (node = added[--i]); ) { | |
if(!node.querySelectorAll){continue;} | |
var els = node.querySelectorAll('div[id$="_hotjar_branding"]'); | |
if(els.length){ | |
els[0].parentNode.removeChild(els[0]); | |
observer.disconnect(); | |
} | |
} | |
}); | |
}); | |
observer.observe(document, { childList: true, subtree : true }); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment