Chrome User Script – Whack page elements based on jQuery selectors

By Beej
// ==UserScript==
// @name VipLeague.se AdBlock Hack
// @match https://www.vipleague.se/*
// ==/UserScript==

function addJQuery(callback) {
  var script = document.createElement("script");
  script.setAttribute("src", "https://code.jquery.com/jquery-2.1.4.min.js");
  script.addEventListener('load', function() {
    var script = document.createElement("script");
    script.textContent = "(" + callback.toString() + ")();";
    document.body.appendChild(script);
  }, false);
  document.body.appendChild(script);
}

function main() {
  $("span:contains('Adblock is enabled')").remove();
}

// load jQuery and execute the main function
addJQuery(main);

![enter image description here][2]</img>

![enter image description here][3]</img>

[2]: /images/uploads/2015/11/Snap2.png “” [3]: /images/uploads/2015/11/Snap4-1.png “”

Tags: WebDev
Share: Twitter Facebook LinkedIn