what scenarios need @ surrogates to run when JS is disabled

Ask for help about NoScript, no registration needed to post
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

what scenarios need @ surrogates to run when JS is disabled

Post by al_9x »

My understanding is that the ability to execute when JavaScript is disabled was added later. I guess cookie manipulation is one reason? Are there others?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

http://forums.informaction.com/viewtopic.php?f=7&t=4542
Imagebam and Imagehaven don't even show any image without the surrogates, unless you enable JS.
More generally speaking, they're useful to provide functionality which would require enabling JS otherwise.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: what scenarios need @ surrogates to run when JS is disab

Post by al_9x »

Thanks, got it, it's for dom manipulation that would normally be done by content script. Is "!@" just shorthand for "@" which attaches a DOMContentLoaded?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

al_9x wrote:Thanks, got it, it's for dom manipulation that would normally be done by content script. Is "!@" just shorthand for "@" which attaches a DOMContentLoaded?
And runs both when scripts are enabled and disabled ("!" alone runs on disabled pages only).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: what scenarios need @ surrogates to run when JS is disab

Post by al_9x »

There is still some confusion
  1. I was under the impression at the time of the first post, that "@" surrogates ran with JS disabled. It turns out that behavior started in .20 stopped in .39 and just restarted in .96. Please clarify, what's intended.
  2. As of 1.9.9.91 "@*" stopped running on about: pages. Bug or design?
  3. even prior to 1.9.9.91 "@*" didn't run on about:blank. Bug or design?
  4. Would be nice to have a surrogate reference section on your site, documenting all the types, when they run in page life-cycle, under what conditions(script, etc), and if any urls are excluded from matching. Perhaps a wiki would be useful, there is a lot of information dispersed across two forums, blog, faq, changelog, features
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

al_9x wrote:I was under the impression at the time of the first post, that "@" surrogates ran with JS disabled. It turns out that behavior started in .20 stopped in .39 and just restarted in .96. Please clarify, what's intended.
@ surrogates have been running with JS disabled for some versions as a side effect of using Components.utils.Sandbox.
Currently Sandbox is used only for ! and !@ surrogates, while DOM injection is used for @ and inclusion surrogate, allowing to play with expandos, content functions and prototypes.
al_9x wrote:As of 1.9.9.91 "@*" stopped running on about: pages. Bug or design?
By design, as a side effect of a better timing strategy for framed pages.
al_9x wrote:even prior to 1.9.9.91 "@*" didn't run on about:blank. Bug or design?
Gecko bug/limitation
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: what scenarios need @ surrogates to run when JS is disab

Post by al_9x »

Giorgio Maone wrote:@ surrogates have been running with JS disabled for some versions as a side effect of using Components.utils.Sandbox.
Currently Sandbox is used only for ! and !@ surrogates, while DOM injection is used for @ and inclusion surrogate, allowing to play with expandos, content functions and prototypes.
I must be misunderstanding. It appears you're saying that @ surrogates used to run with JS disabled, due to the Sandbox, but no longer do (intentionally), since you switched to DOM injection. But I am observing the exact opposite. @ surrogates did not run with JS disabled from .39 to .95 and just started in .96. So again, are @ surrogates supposed to run with JS disabled or not?
Giorgio Maone wrote:
al_9x wrote:As of 1.9.9.91 "@*" stopped running on about: pages. Bug or design?
By design, as a side effect of a better timing strategy for framed pages.
I don't understand, in another thread you said that "@*" was intended to match all urls, including chrome: and about:, so why should "a better timing strategy" now prevent execution on about: urls?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

al_9x wrote:@ surrogates did not run with JS disabled from .39 to .95 and just started in .96. So again, are @ surrogates supposed to run with JS disabled or not?
I don't know how you're observing that. "@" surrogate have not been running on JS disabled pages for a long time, and they still do not. "!@" (or "@!") and "!" surrogates do.
Giorgio Maone wrote:I don't understand, in another thread you said that "@*" was intended to match all urls, including chrome: and about:, so why should "a better timing strategy" now prevent execution on about: urls?
Implementation details. Matching all URLs was nice, but not that useful. Being able to run before the DOM was parsed was much more important, and at this moment it can be consistently made across frame for HTTP URLs only.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: what scenarios need @ surrogates to run when JS is disab

Post by al_9x »

Giorgio Maone wrote:I don't know how you're observing that.
If you're referring to @ surrogates running on JS disabled pages in .96, then very simply, with a test surrogate:

Code: Select all

noscript.surrogate.test.replacement=alert('test surrogate');
noscript.surrogate.test.sources=@*
and it does alert on non whitelisted pages, in .95 it doesn't
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

Mmm, that's correct. My test page (for all the types, together) had a bug :(
However, that's not how's intended to work.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: what scenarios need @ surrogates to run when JS is disab

Post by Giorgio Maone »

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
Post Reply