tharglet

Eat them nerfs

Feb 15th, 2014
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       Nerf removal!
  3. // @namespace  
  4. // @version    0.1
  5. // @description  QQ moar!
  6. // @match      http://us.battle.net/hearthstone/en/forum/*
  7. // ==/UserScript==
  8.  
  9. function addJQuery(callback) {
  10.     var script = document.createElement("script");
  11.     script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
  12.     script.addEventListener('load', function() {
  13.         var script = document.createElement("script");
  14.         script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
  15.         document.body.appendChild(script);
  16.     }, false);
  17.     document.body.appendChild(script);
  18. }
  19.  
  20. function main(){
  21.     jQuery.expr[":"].containsi = jQuery.expr.createPseudo(function(arg) {
  22.         return function( elem ) {
  23.             return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
  24.         };
  25.     });
  26.     $(document).ready(function() {
  27.         $('span[itemprop="headline"]:containsi("nerf")').each(function() {
  28.             $(this).parent().parent().parent().remove();
  29.         });
  30.     });
  31. }
  32. // load jQuery and execute the main function
  33. addJQuery(main);
RAW Paste Data