NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name LeetCode Ads Blocker // @icon https://assets.leetcode.com/static_assets/public/icons/favicon.ico // @namespace https://dizy.cc // @version 1.0.1 // @description Disable LeetCode China Ads at the Global Site // @license MIT // @downloadURL https://openuserjs.org/install/Dizy/LeetCode_Ads_Blocker.user.js // @updateURL https://openuserjs.org/meta/Dizy/LeetCode_Ads_Blocker.meta.js // @author Dizy // @copyright 2021, Dizy (https://openuserjs.org/users/Dizy) // @match *://leetcode.com/* // @grant unsafeWindow // ==/UserScript== (function () { function loadLeetCodeChallenge() { console.log("CN banner ad removed."); } addJS_Node(loadLeetCodeChallenge); function addJS_Node(text, s_URL, funcToRun, runOnLoad) { var D = document; var scriptNode = D.createElement('script'); if (runOnLoad) { scriptNode.addEventListener("load", runOnLoad, false); } scriptNode.type = "text/javascript"; if (text) { scriptNode.textContent = text; } if (s_URL) { scriptNode.src = s_URL; } if (funcToRun) { scriptNode.textContent = '(' + funcToRun.toString() + ')()'; } var targ = D.documentElement || D.body || D.getElementsByTagName('head')[0]; targ.appendChild(scriptNode); } })();