Thanks.
[RESOLVED] Block non-host scripts?
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
[RESOLVED] Block non-host scripts?
Hi, I'm sure there is a way, because noscript is just awesome. but is it possible to block scripts that do not originate from the host, but still whitelist them when on their respective domains? example, google, youtube, facebook etc.
Thanks.
Thanks.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
- Giorgio Maone
- Site Admin
- Posts: 9539
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: Block non-host scripts?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
Re: Block non-host scripts?
Thanks for the quick response man! exactly what i was looking for; i saw it somewhere before, i just couldn't remember where.
Cheers. (:
Cheers. (:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
Re: Block non-host scripts?
Just a quick question with wildcards. would this be a legitimate rule?
Site google.* *.google.*
Accept from google.* *.google.*
Deny
or would i have to specify the TLDs separately?
Thanks.
Site google.* *.google.*
Accept from google.* *.google.*
Deny
or would i have to specify the TLDs separately?
Thanks.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
- Giorgio Maone
- Site Admin
- Posts: 9539
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: Block non-host scripts?
It's OK, but you can collapse google.* and *.google.* into .google.*, so it becomesCaptainUberCool wrote:Just a quick question with wildcards. would this be a legitimate rule?
Site google.* *.google.*
Accept from google.* *.google.*
Deny
or would i have to specify the TLDs separately?
Code: Select all
Site .google.*
Accept from .google.*
Deny
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
Re: Block non-host scripts?
and .google.* would still include a domain that doesn't contain www.? ie just google.com or instance.
Thanks.
Thanks.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
- Giorgio Maone
- Site Admin
- Posts: 9539
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: Block non-host scripts?
Yes it would.CaptainUberCool wrote:and .google.* would still include a domain that doesn't contain www.? ie just google.com or instance.
.google.com matches both http://www.google.com and google.com, while *.google.com matches all the subdomains but NOT google.com, and google.com matches only google.com.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
Re: Block non-host scripts?
Thanks man, a very useful feature!
Thanks again. (:
Thanks again. (:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
-
CaptainUberCool
- Posts: 6
- Joined: Fri Aug 20, 2010 4:22 pm
Re: Block non-host scripts?
it appears that some GET requests are being blocked. signing into youtube, which requires google.com and google.com's rss feeds homepage which requires gmodules.com.
i can sign into gmail ok, from there i can access my rss homepage, but obviously still not youtube.
here are the broken rules:
i have tried
but to no avail.
here are snapshots of the error messages.
google.co.uk
http://img695.imageshack.us/img695/678/snapshot8j.jpg

youtube.co.uk
http://img808.imageshack.us/img808/3049/snapshot7y.jpg

Thanks. sorry to take up your time.
i can sign into gmail ok, from there i can access my rss homepage, but obviously still not youtube.
here are the broken rules:
Code: Select all
# block google except on google
Site .google.*
Accept from .google.*
Deny
# block youtube
Site .youtube.*
Accept from .youtube.*
Deny
i have tried
Code: Select all
# block google except on google
Site .google.* .gmodules.*
Accept from .google.*
Deny
# block youtube
Site .youtube.* .google.*
Accept from .youtube.*
Deny
here are snapshots of the error messages.
google.co.uk
http://img695.imageshack.us/img695/678/snapshot8j.jpg

youtube.co.uk
http://img808.imageshack.us/img808/3049/snapshot7y.jpg

Thanks. sorry to take up your time.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
- Giorgio Maone
- Site Admin
- Posts: 9539
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: Block non-host scripts?
Rather than DENYing everything, you probably want to deny only some kinds of INCLUSIONs, e.g. SCRIPTs and OBJects:
Furthermore, you can choose to ACCEPT requests from some sites (.gmodules.com and .youtube.com in this case), e.g.:
Please check the docs at http://noscript.net/abe for more details.
Code: Select all
Site .google.*
Accept from .google.*
Deny INCLUSION(SCRIPT, OBJ)
Code: Select all
Site .google.*
Accept from .google.* .youtube.com .gmodules.com
Deny INCLUSION(SCRIPT, OBJ)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
-
Guest
Re: [RESOLVED] Block non-host scripts?
Thanks, i read over that post you linked. It, was interesting. it seems simple enough, but if it's not too much trouble, could i run a couple of questions by you?
i noticed the recaptchas on certain sites broke, so i amended the google rule. is it still valid?
secondly, there is an article here:
http://arstechnica.com/business/guides/ ... acking.ars
that states a rule like this is necessary.
wouldn't:
be suffice?
i just want to clear up some misunderstandings before i start making rules. thank you.
i noticed the recaptchas on certain sites broke, so i amended the google rule. is it still valid?
Code: Select all
Site .google.com/recaptcha* // i added these two lines.
Accept from ALL
Site .google.*
Accept from .google.* .youtube.* .gmodules.*
Deny INCLUSION(SCRIPT, OBJ)
http://arstechnica.com/business/guides/ ... acking.ars
that states a rule like this is necessary.
Code: Select all
Site http://ad.doubleclick.net/adj/ars.dart/
Accept from arstechnica.com *.arstechnica.com
Deny
Site doubleclick.net *.doubleclick.net
Deny
Code: Select all
Site http://ad.doubleclick.net/adj/ars.dart/
Accept from arstechnica.com *.arstechnica.com
Deny
i just want to clear up some misunderstandings before i start making rules. thank you.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8
- Giorgio Maone
- Site Admin
- Posts: 9539
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: [RESOLVED] Block non-host scripts?
It's fine, provided that "// i added these two lines" is not really there.Guest wrote: i noticed the recaptchas on certain sites broke, so i amended the google rule. is it still valid?Code: Select all
Site .google.com/recaptcha* // i added these two lines. Accept from ALL Site .google.* Accept from .google.* .youtube.* .gmodules.* Deny INCLUSION(SCRIPT, OBJ)
Comments can only be introduced by a "#" at the beginning of the line.
Yes. However Ars Technica's rules blocks any request (not just scripts and active content) for doubleclick.com.Guest wrote: secondly, there is an article here:
http://arstechnica.com/business/guides/ ... acking.ars
that states a rule like this is necessary.
wouldn't:Code: Select all
Site http://ad.doubleclick.net/adj/ars.dart/ Accept from arstechnica.com *.arstechnica.com Deny Site doubleclick.net *.doubleclick.net Denybe suffice?Code: Select all
Site http://ad.doubleclick.net/adj/ars.dart/ Accept from arstechnica.com *.arstechnica.com Deny
Their rule could be simplified using the collapsed "domain + subdomains" form, though:
Code: Select all
Site http://ad.doubleclick.net/adj/ars.dart/
Accept from .arstechnica.com
Site .doubleclick.net
Deny
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Re: Block non-host scripts?
Giorgio, it seems that I'm having a mental block right now. I'm not able to fully understand the difference between .google.com and *.google.comGiorgio Maone wrote: .google.com matches both http://www.google.com and google.com, while *.google.com matches all the subdomains but NOT google.com, and google.com matches only google.com.
Could you please give some examples how this syntax really works?
Mozilla/5.0 (X11; U; Linux x86_64; de-DE; rv:1.9.2.9pre) Gecko/20100822 Ubuntu/10.04 (lucid) Namoroka/3.6.9pre
Re: [RESOLVED] Block non-host scripts?
- .example.com matches example.com and bla.example.com
- *.example.com just matches bla.example.com
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4) Gecko/20100818 Firefox/4.0b4
Re: [RESOLVED] Block non-host scripts?
Ah - thank you. This makes it clearer. (I told you I had a mental blockdhouwn wrote:It's an extension to the common globbing mechanism.
- .example.com matches example.com and bla.example.com
- *.example.com just matches bla.example.com
Mozilla/5.0 (X11; U; Linux x86_64; de-DE; rv:1.9.2.9pre) Gecko/20100822 Ubuntu/10.04 (lucid) Namoroka/3.6.9pre