[RESOLVED] Block Javascripts with ABE: Websites keep loading

Discussions about the Application Boundaries Enforcer (ABE) module
SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

[RESOLVED] Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Tue Oct 04, 2016 8:01 am

I'm having a problem in blocking some javascripts (Google Ad stuffs) on all websites apart from a specific one (let's call it www.do-not-block.com).
I'm using an ABE rule which is working as expected, however all the websites using the blocked javascripts have their Firefox loading wheel never stopping (it stops only on the www.do-not-block.com website). It seems that the websites are unable to completely load if I block such javascripts with ABE (if I untrust them with NoScript I have no spinning wheel problem).

I've done the following things:
1) I've whitelisted www.do-not-block.com in NoScript
2) I've marked as trusted in Noscript the scripts from googletagservices.com, googleadservices.com, doubleclick.com (otherwise they were market as untrusted)
3) I've added the following rule to ABE:

Code: Select all

Site .googletagservices.com .googleadservices.com .doubleclick.com
Accept from www.do-not-block.com
Deny INCLUSION(SCRIPT)


I don't know if it is related but regarding Google Ad javascripts I know that googletagservices.com load first, which then loads googleadservices.com, which then loads doubleclick.com.

Obviously, if I disable ABE I don't have the spinning wheel but I have the Ads loading, if instead I untrust the scripts I have www.do-not-block.com blocking me the articles.

Any idea on what could cause the issue?
Last edited by barbaz on Wed Oct 05, 2016 10:50 pm, edited 2 times in total.
Reason: kill board-generated links
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

barbaz
Senior Member
Posts: 9788
Joined: Sat Aug 03, 2013 5:45 pm

Re: Block Javascripts with ABE: Websites keep loading

Post by barbaz » Tue Oct 04, 2016 4:24 pm

Active content blocking is much more than just blocking external .js files. This is how to emulate it in ABE:

Code: Select all

Site .googletagservices.com .googleadservices.com .doubleclick.com
Accept from www.do-not-block.com
Deny INCLUSION(SCRIPT, OBJ, FONT, XHR, MEDIA)
Sandbox
*Always* check the changelogs BEFORE updating that important software!
-

SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

Re: Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Tue Oct 04, 2016 4:52 pm

barbaz wrote:Active content blocking is much more than just blocking external .js files. This is how to emulate it in ABE:

Code: Select all

Site .googletagservices.com .googleadservices.com .doubleclick.com
Accept from www.do-not-block.com
Deny INCLUSION(SCRIPT, OBJ, FONT, XHR, MEDIA)
Sandbox


Many thanks barbaz for your reply but it seems it's not working.

Some examples:
https://www.ft.com/
http://www.nytimes.com/
http://www.wsj.com/articles/european-leaders-and-officials-welcome-brexit-trigger-announcement-1475503245
http://www.nytimes.com/2016/10/04/us/politics/trump-foundation-money.html
http://www.ilsole24ore.com/art/notizie/2016-10-04/il-richiamo-concentrare-risorse-crescita-084622.shtml
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

barbaz
Senior Member
Posts: 9788
Joined: Sat Aug 03, 2013 5:45 pm

Re: Block Javascripts with ABE: Websites keep loading

Post by barbaz » Tue Oct 04, 2016 5:06 pm

I would suggest that your Site line might need tweaking. You probably want to include googlesyndication. Also, doubleclick.net

Additionally, try duplicating the Site line into the Accept line:

Code: Select all

Site .googletagservices.com .googleadservices.com .doubleclick.com
Accept from www.do-not-block.com .googletagservices.com .googleadservices.com .doubleclick.com
Deny INCLUSION(SCRIPT, OBJ, FONT, XHR, MEDIA)
Sandbox
*Always* check the changelogs BEFORE updating that important software!
-

SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

Re: Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Wed Oct 05, 2016 7:50 am

barbaz wrote:I would suggest that your Site line might need tweaking. You probably want to include googlesyndication. Also, doubleclick.net

Additionally, try duplicating the Site line into the Accept line:

Code: Select all

Site .googletagservices.com .googleadservices.com .doubleclick.com
Accept from www.do-not-block.com .googletagservices.com .googleadservices.com .doubleclick.com
Deny INCLUSION(SCRIPT, OBJ, FONT, XHR, MEDIA)
Sandbox


Thx again barbaz but still it doesn't work.
That's fine, I've found another solution to my problem by using custom filters on AdBlock Pro and disabling ABE.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

barbaz
Senior Member
Posts: 9788
Joined: Sat Aug 03, 2013 5:45 pm

Re: Block Javascripts with ABE: Websites keep loading

Post by barbaz » Wed Oct 05, 2016 3:36 pm

SergeGardien wrote: AdBlock Pro

Now that would explain why the ABE stuff didn't work, wouldn't it?

SergeGardien wrote:disabling ABE.

Why?
What happened when you just remove the rules related to this?
*Always* check the changelogs BEFORE updating that important software!
-

SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

Re: Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Wed Oct 05, 2016 3:50 pm

barbaz wrote:
SergeGardien wrote: AdBlock Pro

Now that would explain why the ABE stuff didn't work, wouldn't it?

I've disabled completely ABP before testing with ABE.

barbaz wrote:
SergeGardien wrote:disabling ABE.

Why?

Because this was the only thing I was using ABE for.

barbaz wrote:What happened when you just remove the rules related to this?

By removing these ABE rules I don't have anymore the spinning wheel.

Anyway, my final solution is to use "uBlock Origin" addon. I've again marked as untrusted all the 3 Google Ads javascripts in NoScript (googletagservices.com googleadservices.com doubleclick.com) and the website I was looking for doesn't give me any issue.

I still use NoScript, now with "uBlock Origin" and they seems working fine together (if you're mindful of the possible conflicts and how to circumvent them).

Thanks again
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

barbaz
Senior Member
Posts: 9788
Joined: Sat Aug 03, 2013 5:45 pm

Re: Block Javascripts with ABE: Websites keep loading

Post by barbaz » Wed Oct 05, 2016 4:20 pm

SergeGardien wrote:Because this was the only thing I was using ABE for.

The SYSTEM ruleset contains a default rule to prevent webpages tampering with your local network, which includes your computer or router.

SergeGardien wrote:I still use NoScript, now with "uBlock Origin" and they seems working fine together (if you're mindful of the possible conflicts and how to circumvent them).

off-topic: Smart choice ;) I also use uBlock Origin with NoScript. But what possible conflicts do you have in mind?

Occasionally, there are these weird cases where we just can't seem to make certain sites work. All the cases I can recall are sites using Flash.
I know it's something I've done to my browser, copying the profile to a friend's PC and they get exactly the same issues. Never found the culprit. Hoping this might shed some light.

Thanks. :)

SergeGardien wrote:By removing these ABE rules I don't have anymore the spinning wheel.

Anyway, my final solution is to use "uBlock Origin" addon. I've again marked as untrusted all the 3 Google Ads javascripts in NoScript (googletagservices.com googleadservices.com doubleclick.com) and the website I was looking for doesn't give me any issue.

I still use NoScript, now with "uBlock Origin" and they seems working fine together (if you're mindful of the possible conflicts and how to circumvent them).

Thanks again

You're welcome. Thank you for posting the solution and good to hear it's working for you. Image
*Always* check the changelogs BEFORE updating that important software!
-

SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

Re: Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Wed Oct 05, 2016 4:56 pm

barbaz wrote:The SYSTEM ruleset contains a default rule to prevent webpages tampering with your local network, which includes your computer or router.

I didn't realize that. My ABE was already disabled (I don't recall if/when I've done it).
I'll re-enable it. Thx.

barbaz wrote:But what possible conflicts do you have in mind?

Nothing specific but given that ABP/NoScript sometimes weren't playing very well together I suppose I need to be mindful of possible issues with uBlock/NoScript. Anyway, it's more related to the fact that sometimes, if a website brakes down, I need to investigate its interaction with the single addons by having one enabled at a time.

barbaz wrote:Occasionally, there are these weird cases where we just can't seem to make certain sites work. All the cases I can recall are sites using Flash.

Hehe, you're right the Flash beast is sometimes untamable :)

barbaz wrote: Thank you for posting the solution and good to hear it's working for you.


Thanks to you barbaz for helping out ;)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

barbaz
Senior Member
Posts: 9788
Joined: Sat Aug 03, 2013 5:45 pm

Re: Block Javascripts with ABE: Websites keep loading

Post by barbaz » Wed Oct 05, 2016 5:51 pm

SergeGardien wrote:Nothing specific but given that ABP/NoScript sometimes weren't playing very well together I suppose I need to be mindful of possible issues with uBlock/NoScript. Anyway, it's more related to the fact that sometimes, if a website brakes down, I need to investigate its interaction with the single addons by having one enabled at a time.

Oh, that deal. That is less of a problem with uBlock Origin than with ABP.

Technical explanation: ABP and NoScript's script blocking both use nsIContentPolicy, where the order run is somewhat indeterminate.

Let's say we have a site where 3rd-party script from example.net is being loaded. Only script from example.net, no images or css or the like. And let's say ABP lists block example.net, and example.net is also forbidden in NoScript.

Sometimes, in this situation, example.net would be seen only by ABP. Other times, only by NoScript.
But there are times when both addons see it and block it at the same time.

You could check the ABP blockable items and make a whitelist, but until you reload the page and also allow it in the NoScript menu, it'll still be blocked. Or vice versa. This is all trial-and-error - you need to check both, reloading the page after every change, to be sure.

uBlock Origin uses a HTTP observer, which runs after nsIContentPolicy and thus after NoScript's active content blocking. Therefore, uBlock Origin will not see example.net until it has been (Temp-)Allowed in NoScript. This is deterministic, you know to always check NoScript first, and if allowing example.net there doesn't seem to have any effect, then check uBlock Origin. Same order every time.

Anyway that's probably more information than you wanted to know, but hope it helps.

SergeGardien wrote:Thanks to you barbaz for helping out ;)

You're welcome.
*Always* check the changelogs BEFORE updating that important software!
-

SergeGardien
Posts: 18
Joined: Fri Jan 02, 2015 12:10 am

Re: Block Javascripts with ABE: Websites keep loading

Post by SergeGardien » Wed Oct 05, 2016 9:09 pm

barbaz wrote:Anyway that's probably more information than you wanted to know, but hope it helps.

Cool. Many thanks barbaz, that's a very good and concise explanation of how NoScript can work in tandem with ABP and uBlock. Actually, it is very useful to know.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

Post Reply