TheDailyWTF

Show hidden comment surprises for the dailywtf

  1. // ==UserScript==
  2. // @name TheDailyWTF
  3. // @namespace http://local.host/I.Dont.Wanna.Post.One
  4. // @version 0.5
  5. // @description Show hidden comment surprises for the dailywtf
  6. // @match http://thedailywtf.com/articles/*
  7. // @copyright 2014+, Milton Zurita
  8. // ==/UserScript==
  9.  
  10. if(jQuery) {
  11. var style="color:green;background:#CCFFCC;margin:2px;font-size:0.65em;"
  12. var lookFor='.article-body';
  13. var regEx = /<\!--(.+)-->/g
  14. $(window).load(function(){
  15. var target = $(lookFor);
  16. var result = $(lookFor).html().replace(regEx,'<span style="'+style+'">\$1</span>');
  17. target.html(result);
  18. });
  19. }