Skip to content

Instantly share code, notes, and snippets.

@cabrinha
Forked from brianmed/gist:eee071cb8606d3069694
Last active August 29, 2015 14:23
Show Gist options
  • Save cabrinha/86257dc33bfa40a30ece to your computer and use it in GitHub Desktop.
Save cabrinha/86257dc33bfa40a30ece to your computer and use it in GitHub Desktop.
<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