Skip to content

Instantly share code, notes, and snippets.

@m-hume
Created July 28, 2018 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m-hume/f07951207372426f9f94638c4c5f82ff to your computer and use it in GitHub Desktop.
Save m-hume/f07951207372426f9f94638c4c5f82ff to your computer and use it in GitHub Desktop.
Remove hotjar branding from feedback
(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