Skip to content

Instantly share code, notes, and snippets.

@nsheridan
Created July 23, 2012 16:23
Show Gist options
  • Save nsheridan/3164546 to your computer and use it in GitHub Desktop.
Save nsheridan/3164546 to your computer and use it in GitHub Desktop.
Vastly improve the readability of youtube comments
// ==UserScript==
// @name Youtube Moroniser
// @namespace nsheridan
// @include http://www.youtube.com/*
// ==/UserScript==
var thisComment;
var comments = document.evaluate("//div[@class='comment-text']", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
if (comments) {
for (var i = 0; i < comments.snapshotLength; i++) {
thisComment = comments.snapshotItem(i);
comments.snapshotItem(i).innerHTML = thisComment.innerHTML +
'<p>But then, I\'m a fucking moron</p>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment