double invocation of normal inclusion surrogates

Bug reports and enhancement requests
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

double invocation of normal inclusion surrogates

Post by al_9x »

Fx 7.0, NS 2.1.3, new profile

runs the first time before the @ surrogate:

test page:

Code: Select all

<script src="http://domain.invalid/"></script>
surrogates:

Code: Select all

noscript.surrogate.normal.sources=*
noscript.surrogate.normal.replacement=console.log('normal surrogate');

noscript.surrogate.@.sources=@*
noscript.surrogate.@.replacement=console.log('@ surrogate');
console log:

Code: Select all

[05:56:03.622] normal surrogate @ chrome://noscript/content/ScriptSurrogate.js:193
[05:56:03.627] @ surrogate @ http://localhost/tests/surrogates/normal-simple.htm:10
[05:56:03.631] normal surrogate @ http://localhost/tests/surrogates/normal-simple.htm
the log seems to be indicating that the first invocation is from chrome
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: double invocation of normal inclusion surrogates

Post by Giorgio Maone »

Looks like an artifact of Gecko's speculative loading. Investigating, thanks.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: double invocation of normal inclusion surrogates

Post by Giorgio Maone »

Mozilla/5.0 (Windows NT 5.2; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: double invocation of normal inclusion surrogates

Post by al_9x »

Giorgio Maone wrote:Should be fixed in latest development build 2.1.4rc2
So what was going on there? What is this speculative parsing? Is gecko querying the policy twice about the same script? Why?
Mozilla/5.0 (Windows NT 5.1; rv:7.0) Gecko/20100101 Firefox/7.0
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: double invocation of normal inclusion surrogates

Post by Giorgio Maone »

al_9x wrote:
Giorgio Maone wrote:Should be fixed in latest development build 2.1.4rc2
So what was going on there? What is this speculative parsing?
Recent Gecko versions try to parallelize external resources preloading, starting the loads as soon as their URLs can be seen in the response stream and independently from DOM building.
al_9x wrote:Is gecko querying the policy twice about the same script? Why?
Yes, it is. Once when the load is about to start (which generally happens before the script DOM element exists - in fact, the document itself is passed as aContext) and once when the DOM element is created (even if at that time the load may have already been vetoed by the previous call).
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0
Post Reply