Page 1 of 2

The exceptions not works

Posted: Sun May 18, 2014 10:42 pm
by fanN
I need enabling exception for gentoo.org but with each exception breaked filter.
Example for script piwik http://sourceforge.net/apps/piwik/supertuxkart/piwik.js (for example blocking) and https://piwik.gentoo.org/piwik.js (I need exception here)
works

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
these all aren't working

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from ^https?://([a-z0-9\.-]+\.)?gentoo\.org
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from ^https?://([a-z0-9\.-]+\.)?gentoo\.org/.*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from .gentoo.org
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from .gentoo.org*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept from *.gentoo.org*
Deny

Code: Select all

Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Accept ALL from *.gentoo.org
Deny
Please, how does it make?

Re: The exceptions not works

Posted: Sun May 18, 2014 11:02 pm
by barbaz

Code: Select all

Site https://piwik.gentoo.org/piwik.js
Accept from [DOMAIN_OF_SITE_WHERE_YOU_WANT_THAT_SCRIPT_ALLOWED]

Site ^https?://.+/piwik\.js
Deny
replacing [DOMAIN_OF_SITE_WHERE_YOU_WANT_THAT_SCRIPT_ALLOWED] with the actual domain of the site that includes that script, or ALL if you want it allowed from anywhere

Re: The exceptions not working

Posted: Sun May 18, 2014 11:32 pm
by fanN

Code: Select all

Site https://piwik.gentoo.org/piwik.js Accept from .gentoo.org
Site https://webstats.gnome.org/piwik.js Accept from .gentoo.org
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
Super, Thank you very much

Re: The exceptions not working

Posted: Sun May 18, 2014 11:38 pm
by fanN
I am cow ...

Code: Select all

Site https://piwik.gentoo.org/piwik.js Accept from .gentoo.org
Site https://webstats.gnome.org/piwik.js Accept from .gnome.org
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
Now it is right

Re: The exceptions not works

Posted: Mon May 19, 2014 12:32 am
by fanN
This but not works

Code: Select all

#- analytics whitelist
Site https://piwik.gentoo.org Accept from .gentoo.org 
Site ^https?://piwik\.
Deny
Site http://sourceforge.net/apps/piwik/ Accept from sourceforge.net
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik/
Deny
Site https://webstats.gnome.org/piwik.js Accept from .gnome.org
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js Accept from this-sucks.net
Site ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny
This had to be blocked but isn't

Code: Select all

Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js Accept from this-sucks.net

Re: The exceptions not works

Posted: Mon May 19, 2014 1:45 am
by barbaz
I'm not quite sure what you're trying to do?

the Accept part needs to be on its own line

this maybe?

Code: Select all

#- analytics whitelists
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js
Accept from this-sucks.net
Deny

Site https://piwik.gentoo.org
Accept from .gentoo.org
Site http://sourceforge.net/apps/piwik/
Accept from sourceforge.net
Site https://webstats.gnome.org/piwik.js
Accept from .gnome.org

Site ^https?://piwik\. ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik/ ^https?://[a-zA-Z0-9&%/\?=\._:;-]+/piwik\.js
Deny

Re: The exceptions are not working

Posted: Tue May 20, 2014 4:28 am
by fanN
NO,
...
Blocking without gentoo.org

Code: Select all

Site  https://piwik.gentoo.org/piwik.js
Accept from .gentoo.org
Site ^https?://piwik\.
Deny
OK

Blocking includes gentoo.org (new rule)

Code: Select all

Site https://piwik.gentoo.org/piwik.js
Accept from .gentoo.org
Site ^https?://piwik\.
Deny
# this rule isn't matched for blocking again all
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik\.js
Deny
Not OK
I can't use new rules that breaking the previous.

Re: The exceptions not works

Posted: Tue May 20, 2014 11:33 am
by Thrawn
It's still very hard to understand what you're actually trying to do.

Would something like this help?

Code: Select all

Site ^.*piwik.*
Accept from .gentoo.org
Deny

Re: The exceptions not working

Posted: Wed May 21, 2014 10:10 pm
by fanNS
No,

Code: Select all

#- block all in 1. level domain without piwik.alpha.org/script/piwik.js
Site http://piwik.alpha.org/script/piwik.js
Accept from .alpha.org
Site http://piwik.
Deny

#- block all beyond directory script or js like piwik.gentoo.org/script/virus.js  and  piwik.beta.org/js/virus.js but not gift.org/js/gifts.js
Site http://gift.org/js/gifts.js
Accept from gift.org
Site ^http://.*/(js|script)/
Deny

#- block all gifts.js but not from piwik.alpha.org/gifts/gifts.js
Site http://piwik.org/gifts/gifts.js
Accept from .alpha.org
Site http://*/gifts.js
Deny
The problem is in the first rule that block the exception in the third rule. Simply in NoScript isn't possible advance exceptions.

Re: The exceptions not working

Posted: Wed May 21, 2014 11:54 pm
by barbaz
fanNS wrote:The problem is in the first rule that block the exception in the third rule.
Try moving all your exceptions to the top of the ruleset, like this:

Code: Select all

#alpha.org whitelists
Site http://piwik.alpha.org/script/piwik.js http://piwik.org/gifts/gifts.js
Accept from .alpha.org

#gift.org whitelist
Site http://gift.org/js/gifts.js
Accept from gift.org

#- block all in 1. level domain
Site http://piwik.
Deny

#- block all beyond directory script or js like piwik.gentoo.org/script/virus.js  and  piwik.beta.org/js/virus.js
Site ^http://.*/(js|script)/
Deny

#- block all gifts.js but not from piwik.alpha.org/gifts/gifts.js
Site http://*/gifts.js
Deny

Re: The exceptions not working

Posted: Thu May 22, 2014 6:35 pm
by fanNS
Thank for answers and I'm sorry for my bad English. I'm using NoScript v. 2.6.8.24
You try this real example,

Code: Select all

#- analytics whitelists
Site https://piwik.gentoo.org/piwik.js #- begin
Accept from .gentoo.org
Site http://sourceforge.net/apps/piwik/supertuxkart/piwik.js #- middle
Accept from this-sucks.net #- the domain isn't right wrote therefore has to be blocked but isn't 
Site https://webstats.gnome.org/piwik.js #- end
Accept from .gnome.org

Site ^https?://piwik\. #-begin
Deny
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik/ #-middle
Deny
Site ^https?://[a-zA-Z0-9_\-\.\[\]:/@~;,\?&=%#]+/piwik\.js  #- end
Deny

Re: The exceptions not works

Posted: Thu May 22, 2014 6:49 pm
by barbaz
On what URL(s)? What are the desired results (what resources should be blocked, and what resources should *not* be blocked)?

Re: The exceptions not works

Posted: Thu May 22, 2014 7:24 pm
by fanNS
OK, I understand so,
for the begin https://piwik.pro/enterprise - is blocked - it's right
for the middle https://github.com/piwik/piwik/tree/master/js - is blocked - it's right
for the end

Code: Select all

code.google.com/p/best-trade-plus/source/browse/trunk/TradePlus/web/pm/js/piwik.js?r=27
- is blocked - it's right

Why doesn't url of sourceforge.net blocked if there is bad domain in the exception?

Re: The exceptions not works

Posted: Thu May 22, 2014 8:00 pm
by barbaz
Where are you seeing the sourceforge.net script included?

If you're trying to go there directly in the browser, and it's loading, I see that too, and it looks like that's expected behavior resulting from the presence of the exception.

Re: The exceptions not works

Posted: Fri May 23, 2014 5:04 am
by Thrawn
I think the trouble is that you should not use backslashes inside character classes (the square brackets).

How about this?

Code: Select all

Site ^https?://(piwik\.|.*/piwik/|.*/piwik\.js)
Deny