Blocking javascript

Various discussions related to Adblock Plus development
Post Reply
ankar
Posts: 5
Joined: Thu Apr 02, 2015 10:39 am

Blocking javascript

Post by ankar »

Does AdBlockPlus block javascripts directly or does it let them render the ads first and then blocks the ads?
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Blocking javascript

Post by Gingerbread Man »

External JavaScript files are blocked. That is, Adblock Plus prevents the HTTP(S) request from being sent, so the file doesn't load.

Code: Select all

<script type="text/javascript" src="http://example.com/ads.js"></script>
Inline JavaScript cannot be blocked, since it's a part of the page. In these cases, the external image or video files are blocked. In the case of text ads, the container element is hidden (the ad is technically still on the page, but you won't see it).

Code: Select all

<script type="text/javascript">function addAds() { // do something on the page.  }</script>
ankar
Posts: 5
Joined: Thu Apr 02, 2015 10:39 am

Re: Blocking javascript

Post by ankar »

Thanks a lot for your response. I am new to JavaScript, web extensions and to the AdBlock code base in particular. So could you please point me to the relevant logic/code snippet in the code base for Ad block Plus for Chrome which is blocking javascript? I have been trying to figure it out but I havent been unable to. Thanks in advance.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Blocking javascript

Post by Gingerbread Man »

ankar wrote:So could you please point me to the relevant logic/code snippet in the code base for Ad block Plus for Chrome which is blocking javascript?
Blocking JavaScript isn't a special case. Adblock Plus can block external content of any kind: JavaScript, images, video, audio, fonts, style sheets, and so on. If an external resource matches an existing blocking filter, then it gets blocked.
sunexim
Posts: 1
Joined: Thu May 21, 2015 12:35 pm

Re: Blocking javascript

Post by sunexim »

I have a script that pulls data from my CMS and then allows a person to vote on a poll. The script works fine. However, I have Ad Block Plus Plugin installed in Firefox. When that is enabled to blocks the script from submitting the form correctly. It appears to submit correctly in the front end but is never registered in the back end.

Why does Ad Block Plus block my script that has nothing to do with ads?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking javascript

Post by mapx »

1.don't include other (invisible) links in your posts.
2.what's the page, the script, how to reproduce the issue ?
Post Reply