Allowing JS for a 3rd party site only on a given 1st party
-
Sam
Allowing JS for a 3rd party site only on a given 1st party
Hi,
Let's say I want to permanently allow ajax.googleapis.com ONLY on a given site. How would I do this ?
Curiosity question: If that site is allowed normally (i.e. not using the solution to this thread's question), but the website I am currently on doesn't have JS enabled, will ajax.googleapis.com scripts be downloaded ? If so, will they be run ?
Looks like the answer to both questions is "no", but that could be because I checked on a site that uses JS to download and run Ajax. I'm thinking Ajax always needs to be called by the first party script otherwise it never runs, but it can be downloaded without JS. Is that correct ?
Thanks!
Let's say I want to permanently allow ajax.googleapis.com ONLY on a given site. How would I do this ?
Curiosity question: If that site is allowed normally (i.e. not using the solution to this thread's question), but the website I am currently on doesn't have JS enabled, will ajax.googleapis.com scripts be downloaded ? If so, will they be run ?
Looks like the answer to both questions is "no", but that could be because I checked on a site that uses JS to download and run Ajax. I'm thinking Ajax always needs to be called by the first party script otherwise it never runs, but it can be downloaded without JS. Is that correct ?
Thanks!
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Re: Allowing JS for a 3rd party site only on a given 1st par
http://noscript.net/faq#qa8_10Sam wrote:Hi,
Let's say I want to permanently allow ajax.googleapis.com ONLY on a given site. How would I do this ?
Not unless they are in an iframe from ajax.googleapis or another allowed site.Sam wrote:Curiosity question: If that site is allowed normally (i.e. not using the solution to this thread's question), but the website I am currently on doesn't have JS enabled, will ajax.googleapis.com scripts be downloaded ?
JS files called by the forbidden site: noSam wrote:If so, will they be run ?
scripts inlined in or requested by an iframe from an allowed site: yes, unless you set about:config -> noscript.restrictSubdocScripting to true
The second part only. A simple script tag will get the ajax script to run, but it may not actually do anything if it's just defining a set of APIs that never get used.Sam wrote:I'm thinking Ajax always needs to be called by the first party script otherwise it never runs, but it can be downloaded without JS. Is that correct ?
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux i686; rv:33.0) Gecko/20140616 Firefox/33.0 SeaMonkey/2.30a1
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
Thanks.
Just to make sure I got it:
I didn't think of using ABE. I was hoping for something more straightforward like a whilelist item ajax.googleapis.com@example.com
ABE is fine though, but I'd be glad to hear it if there is a way to do it with the whitelist
Just to make sure I got it:
But the script tag will not run if the first party site has JS forbidden, so in that case both parts of my assumption are correct right ?The second part only. A simple script tag will get the ajax script to run, but it may not actually do anything if it's just defining a set of APIs that never get used.
I didn't think of using ABE. I was hoping for something more straightforward like a whilelist item ajax.googleapis.com@example.com
ABE is fine though, but I'd be glad to hear it if there is a way to do it with the whitelist
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
Sorry bad wording, let's assume <script> tag is included in that "first party script" thingI'm thinking Ajax always needs to be called by the first party script otherwise it never runs
But IFrame and anything else is not.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Re: Allowing JS for a 3rd party site only on a given 1st par
Sorry about the misunderstanding. No script tags on a forbidden site will run, even if the JS file originates from an allowed site.Sam wrote:But the script tag will not run if the first party site has JS forbidden
IIUC there will be, in NoScript 3..Sam wrote:I was hoping for something more straightforward
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:30.0) Gecko/20100101 Firefox/30.0 SeaMonkey/2.27a2
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
NoScript 3 ? Yay, I wonder what's cooking now. We've been on 2.x for what feels like 5 years or more ^^
Here's hoping for an easier way to allow WebGL games to run.
Oh sorry, I forgot to ask for confirmation: A 3rd party script blocked with ABE amounts to it being forbidden in that, in the eyes of the first party, it doesn't exist. So NoScript surrogates do kick in right ?
PS: The captchas are wayyyyy too hard I failed like 10 times in a row
Here's hoping for an easier way to allow WebGL games to run.
Oh sorry, I forgot to ask for confirmation: A 3rd party script blocked with ABE amounts to it being forbidden in that, in the eyes of the first party, it doesn't exist. So NoScript surrogates do kick in right ?
PS: The captchas are wayyyyy too hard I failed like 10 times in a row
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Re: Allowing JS for a 3rd party site only on a given 1st par
That is viewtopic.php?f=7&t=19289Sam wrote:Here's hoping for an easier way to allow WebGL games to run.
Yes but only as of NoScript 2.6.8.27Sam wrote:Oh sorry, I forgot to ask for confirmation: A 3rd party script blocked with ABE amounts to it being forbidden in that, in the eyes of the first party, it doesn't exist. So NoScript surrogates do kick in right ?
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:30.0) Gecko/20100101 Firefox/30.0 SeaMonkey/2.27a2
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
Oh right! Can't believe I forgot the changelog since it is so recent. Well I'm good to go now, thanks for all the fish! 
*rolls up his sleeves to take on Doom Captcha the Arch-nemesis*
(Yay, only 60 seconds to beat it this time!)
*rolls up his sleeves to take on Doom Captcha the Arch-nemesis*
(Yay, only 60 seconds to beat it this time!)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
From the changelog of NoScript 2.6.8.31:
According to what I understood from the discussion in this thread, notably this:
+ "NoScript Options|Advanced|Untrusted|Block scripting in whitelisted
subdocuments of non-whitelisted pages" user-facing preference
According to what I understood from the discussion in this thread, notably this:
JS files called by the forbidden site: noSam wrote:If so, will they be run ?
scripts inlined in or requested by an iframe from an allowed site: yes, unless you set about:config -> noscript.restrictSubdocScripting to true
There shouldn't be a need to block whitelisted subdocuments because they already can't run in a JS-disabled page. What am I missing ?No script tags on a forbidden site will run, even if the JS file originates from an allowed site.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Re: Allowing JS for a 3rd party site only on a given 1st par
yes, they can run scripts when they're included by a JS-disabled page. that's what i meant bySam wrote:There shouldn't be a need to block whitelisted subdocuments because they already can't run in a JS-disabled page. What am I missing ?
barbaz wrote:scripts inlined in or requested by an iframe from an allowed site: yes, unless you set about:config -> noscript.restrictSubdocScripting to true
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:30.0) Gecko/20100101 Firefox/30.0 SeaMonkey/2.27a2
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
So if this necessitates an IFrame containing an allowed site, then if IFrames are forbidden there's no way for Untrusted|Block scripting in whitelisted subdocuments of non-whitelisted pages to come into play, right ?
Did I completely get it right this time ?
Did I completely get it right this time ?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
Oh f*, yes! IFrames are "subdocuments", dumbhead.
Since the changelog doesn't use the name IFrame directly, I assume there are other types of subdocuments. The question then is, what are they ? Normal Frames ? What else ?
And as long as they're all forbidden, then this feature by definition (if I read correctly) is never triggered.
Since the changelog doesn't use the name IFrame directly, I assume there are other types of subdocuments. The question then is, what are they ? Normal Frames ? What else ?
And as long as they're all forbidden, then this feature by definition (if I read correctly) is never triggered.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
Re: Allowing JS for a 3rd party site only on a given 1st par
I think it doesn't come into play before you click the placeholder to allow the iframe, but it would after you allow the iframe.Sam wrote:So if this necessitates an IFrame containing an allowed site, then if IFrames are forbidden there's no way for Untrusted|Block scripting in whitelisted subdocuments of non-whitelisted pages to come into play, right ?
Yes. In practice I've only seen it used for frames and iframes. More generally, presumably anything that is labeled by the browser asSam wrote:Since the changelog doesn't use the name IFrame directly, I assume there are other types of subdocuments. The question then is, what are they ? Normal Frames ? What else ?
https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentPolicy wrote:TYPE_SUBDOCUMENT 7 Indicates a document contained within another document (for example, IFRAMEs, FRAMES, and OBJECTs).
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux i686; rv:33.0) Gecko/20100101 Firefox/33.0 SeaMonkey/2.30a1
-
Sam
Re: Allowing JS for a 3rd party site only on a given 1st par
Yes that would be expected in that caseI think it doesn't come into play before you click the placeholder to allow the iframe, but it would after you allow the iframe.
I turned the feature on, let's hope that it will be easy to understand why something is broken next time I need an IFrame to have JS. (It barely ever happens so I guess I'll completely forget this feature until it breaks something in an eon or two. Hope the regular NS drop down will help whitelisting the subdocument then)
Thank again for clearing that up. If it's basically plugins, frames and iframes, then it's fine.Yes. In practice I've only seen it used for frames and iframes. More generally, presumably anything that is labeled by the browser as
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0