Skip to content

Instantly share code, notes, and snippets.

@davecowart
Created October 1, 2010 15:20
Show Gist options
  • Save davecowart/606343 to your computer and use it in GitHub Desktop.
Save davecowart/606343 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name No Comment
// @namespace http://daveandbritney.com/greasemonkey
// @description hides ALL comments on AL.com
// @include http://*.al.com/*
// ==/UserScript==
var allComments, thisComment, allReplies;
allComments = document.evaluate("//div[@class='comment']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allComments.snapshotLength; i++) {
thisComment = document.getElementById(allComments.snapshotItem(i).id)
if (thisComment) {
thisComment.parentNode.removeChild(thisComment);
}
}
allReplies = document.evaluate("//div[@class='comment reply']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allReplies.snapshotLength; i++) {
thisComment = document.getElementById(allReplies.snapshotItem(i).id)
if (thisComment) {
thisComment.parentNode.removeChild(thisComment);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment