How to disable a specific javascript function??

Everything about using Adblock Plus on Google Chrome
Post Reply
AaronLandon11
Posts: 1
Joined: Sat Jun 13, 2020 10:58 am

How to disable a specific javascript function??

Post by AaronLandon11 »

I have AdBlock Plus v1.5.4 for Chrome.

I would like to block the following javascript function that is contained in a webpage. I do not want to block the rest of the page. The javascript script is as follows:

<script type="text/javascript">

function TestPage() {
if ($('.myTestAd').height() == 0)
window.location = "http://<redacted>/adblock.php?link=<redacted>";
}

$(TestPage);

</script>

I assume that simply removing or blocking "$(TestPage);" on this page would prevent this script from being executed. However I don't know how to write the rule to block it as this is not a <div> element.

So, does anyone know how to write the rule to block this specific script?
nihitthakkar
Posts: 33
Joined: Mon Jan 25, 2021 10:08 am
Location: USA
Contact:

Re: How to disable a specific javascript function??

Post by nihitthakkar »

To disable the execution of a function in JavaScript, we can use the clearTimeout() method. This function call clears any timer set by the setTimeout() functions. Also, we can go to the menu Tools "> Internet Options "> Security "> Custom Level. Scroll to the Scripting section and click disable. Go to the menu Tools "> Content. Uncheck Enable JavaScript.
Post Reply