Skip to content

Instantly share code, notes, and snippets.

@brianmed
Last active August 29, 2015 14:23
Show Gist options
  • Save brianmed/eee071cb8606d3069694 to your computer and use it in GitHub Desktop.
Save brianmed/eee071cb8606d3069694 to your computer and use it in GitHub Desktop.
Rename the "Tweets" header title
<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