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?
Re: How to disable a specific javascript function?
an inline script (in HTML) can not be blocked; you can block only an external script
you can write a userscript and use it directly in chrome (drag & drop it in the extensions page) or using some script manager (like greasemonkey for firefox or Tampermonkey for chrome)
see also
https://userscripts.org/
you can write a userscript and use it directly in chrome (drag & drop it in the extensions page) or using some script manager (like greasemonkey for firefox or Tampermonkey for chrome)
see also
https://userscripts.org/
Re: How to disable a specific javascript function?
Thanks for the info!
The script at https://userscripts.org/scripts/show/155840 along with the Tampermonkey extension for Chrome did the trick.
The script at https://userscripts.org/scripts/show/155840 along with the Tampermonkey extension for Chrome did the trick.
-
- Posts: 1
- Joined: Sun Nov 17, 2019 8:16 pm
Re: How to disable a specific javascript function?
The UserScripts.org site is down,
but there is a static mirror of the site.
So, the previously mentioned link:
https://userscripts.org/scripts/show/155840
can instead be found at:
https://userscripts-mirror.org/scripts/review/155840
^_^
but there is a static mirror of the site.
So, the previously mentioned link:
https://userscripts.org/scripts/show/155840
can instead be found at:
https://userscripts-mirror.org/scripts/review/155840
^_^