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?
How to disable a specific javascript function??
-
- Posts: 1
- Joined: Sat Jun 13, 2020 10:58 am
-
- Posts: 33
- Joined: Mon Jan 25, 2021 10:08 am
- Location: USA
- Contact:
Re: How to disable a specific javascript function??
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.