Last active
August 29, 2015 14:23
-
-
Save brianmed/eee071cb8606d3069694 to your computer and use it in GitHub Desktop.
Rename the "Tweets" header title
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
<script> | |
var text = document; | |
var observer = new MutationObserver(function(mutations) { | |
mutations.every(function(mutation) { | |
var entry = { | |
mutation: mutation, | |
el: mutation.target, | |
value: mutation.target.textContent, | |
oldValue: mutation.oldValue | |
}; | |
if ($(mutation.target).is("iframe")) { | |
if ($(mutation.target).contents().find(".timeline-header > h1 > a").length) { | |
observer.disconnect(); | |
$(mutation.target).contents().find(".timeline-header > h1 > a").html("Joy"); | |
return false; | |
} | |
} | |
}); | |
}); | |
observer.observe(text, { | |
attributes: true, | |
childList: true, | |
characterData: true, | |
characterDataOldValue: true, | |
subtree: true | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment