Blocking javascript
Blocking javascript
Does AdBlockPlus block javascripts directly or does it let them render the ads first and then blocks the ads?
- Gingerbread Man
- Posts: 1339
- Joined: Fri Aug 12, 2011 5:28 am
Re: Blocking javascript
External JavaScript files are blocked. That is, Adblock Plus prevents the HTTP(S) request from being sent, so the file doesn't load.
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" src="http://example.com/ads.js"></script>
Code: Select all
<script type="text/javascript">function addAds() { // do something on the page. }</script>
Re: Blocking javascript
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.
- Gingerbread Man
- Posts: 1339
- Joined: Fri Aug 12, 2011 5:28 am
Re: 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.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?
Re: Blocking javascript
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?
Why does Ad Block Plus block my script that has nothing to do with ads?
Re: Blocking javascript
1.don't include other (invisible) links in your posts.
2.what's the page, the script, how to reproduce the issue ?
2.what's the page, the script, how to reproduce the issue ?