Skip to content

Instantly share code, notes, and snippets.

@RandalK
Created October 12, 2012 02:35
Show Gist options
  • Save RandalK/3877013 to your computer and use it in GitHub Desktop.
Save RandalK/3877013 to your computer and use it in GitHub Desktop.
tdwtf comments bookmarklet
javascript:(function(){var b=document.getElementById('ArticleFull')||document.getElementsByClassName('ArticleBody')[0];b.innerHTML=b.innerHTML.replace(/<!\-\-/g,'<span style="color: green;">').replace(/\-\->/g,'</span>');})()
@RandalK
Copy link
Author

RandalK commented Oct 12, 2012

not my code found in a comment on thedailywtf.com

@RandalK
Copy link
Author

RandalK commented Oct 12, 2012

not my code found in a comment on thedailywtf.com

@Pr0methean
Copy link

Pr0methean commented Aug 30, 2019

The CSS class name has changed. Here's my updated version, which is forked from https://thedailywtf.com/articles/comments/Connected-to-the-Connector-to-the-Connection-to-the-System#comment-390489:

javascript:(function(b){b.innerHTML=b.innerHTML.replace(/<!--/g,'<span style="color:red;">').replace(/-->/g,'')})(document.querySelector('.article-body'))

Smaller versions are probably possible if you rely on the site's look-and-feel scripts to keep loading jQuery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment