Surrogates stopped working 2.6.9.33

Ask for help about NoScript, no registration needed to post
FB not found

Surrogates stopped working 2.6.9.33

Post by FB not found »

Some websites stopped working with the update to 2.6.9.33 (Firefox 39.0, Windows 7 64-bit). The console said something about "FB not found" javascript error on one website, so i checked the surrogates with a local html file:

Code: Select all

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
alert(FB);
</script>
Same error, no alert window (local file js allowed, facebook not).
Reverting back to 2.6.9.32 and surrogates/websites work and i get the alert window.

Probably only for me, but how can i see what exactly changed between those 2 versions? The code on AMO only shows the current status, but no diff. And i tried to change some LOCs in the xpi, but then FF wanrs me about unsigned, well maybe im not allowed to change addons on my computer anymore ....
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
barbaz
Senior Member
Posts: 11143
Joined: Sat Aug 03, 2013 5:45 pm

Re: Surrogates stopped working 2.6.9.33

Post by barbaz »

It's not just for you, but everyone else reporting this has been on PaleMoon and surrogates broke for them with 2.6.9.32rc1...

Can you please find the exact rc build that first broken for you?
FB not found wrote:how can i see what exactly changed between those 2 versions?
Download the two XPIs, change the extensions to .zip, unzip both, then change the inner .jar file extensions to .zip and unzip those.

Old NoScript @
https://addons.mozilla.org/addon/noscript/versions
*or*
https://noscript.net/feed?c=100&t=a
*Always* check the changelogs BEFORE updating that important software!
-
FB not found

Re: Surrogates stopped working 2.6.9.33

Post by FB not found »

barbaz wrote:...
Can you please find the exact rc build that first broken for you?
...
2.6.9.32 works, 2.6.9.33rc1 is broken.

The change is probably in /chrome/content/noscript/ScriptSurrogate.js line 274

OLD:

Code: Select all

 ? "{let nsmHandler={get:function(t,n)n in t?t[n]:function()t.__noSuchMethod__(n,Array.prototype.slice.call(arguments))};function $S(o)new Proxy(o||{},nsmHandler);}\n" + s
NEW (not working anymore):

Code: Select all

 ? "{let nsmHandler={get:function(t,n)n in t?t[n]:function()t.__noSuchMethod__(n,Array.prototype.slice.call(arguments))};let $S=function(o)new Proxy(o||{},nsmHandler);}\n" + s
Its a bit hard to see in code-tags, but the relevant part is:

Code: Select all

function $S(o)new Proxy(o||{},nsmHandler); //OLD, works
let $S=function(o)new Proxy(o||{},nsmHandler); //NEW, broken
If i only manually edit this line in the currently stable 2.6.9.33 and thus revert it back to what it was in 2.6.9.32, it works again. But why the "let $S=function ... " doesnt work, the "function $S(..." does, i dont know :/
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
barbaz
Senior Member
Posts: 11143
Joined: Sat Aug 03, 2013 5:45 pm

Re: Surrogates stopped working 2.6.9.33

Post by barbaz »

Confirmed - note: not all surrogates are broken, just those that use $S are.
*Always* check the changelogs BEFORE updating that important software!
-
barbaz
Senior Member
Posts: 11143
Joined: Sat Aug 03, 2013 5:45 pm

Re: Surrogates stopped working 2.6.9.33

Post by barbaz »

Actually I think I see it - the let $S is in a different block from the surrogate itself, thus is not available to the surrogate. (The entire code you posted is evaluated in its own block - since it all uses let, that won't do any good.)

The fix is for that code to be evaluated in the *same* block as the surrogate.
*Always* check the changelogs BEFORE updating that important software!
-
Guest

Re: Surrogates stopped working 2.6.9.33

Post by Guest »

barbaz wrote:Actually I think I see it - the let $S is in a different block from the surrogate itself, thus is not available to the surrogate. (The entire code you posted is evaluated in its own block - since it all uses let, that won't do any good.)

The fix is for that code to be evaluated in the *same* block as the surrogate.
But the surrogate code is injected into the websites scope. And then the problem of name collision, which the fix was for, would again be a problem. Maybe changing $S() to something (longer) but unlikely to collide, like $NOSCRIPT_PROXY() could be a fix (but then enable 3rd party content to check for noscript existence based on this function, while $S() is not enough to footprint).

But nvm im sure you guys will find a fix, i dont know much about JS injection via addon ;-)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
barbaz
Senior Member
Posts: 11143
Joined: Sat Aug 03, 2013 5:45 pm

Re: Surrogates stopped working 2.6.9.33

Post by barbaz »

Guest wrote:But the surrogate code is injected into the websites scope.
Not entirely. Surrogates are run in their own blocks, so anything declared with let inside a surrogate is private to the surrogate.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
Giorgio Maone
Site Admin
Posts: 9546
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Surrogates stopped working 2.6.9.33

Post by Giorgio Maone »

Please check latest development build, thanks.
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
barbaz
Senior Member
Posts: 11143
Joined: Sat Aug 03, 2013 5:45 pm

Re: Surrogates stopped working 2.6.9.33

Post by barbaz »

Seems fixed, thanks 8-)
*Always* check the changelogs BEFORE updating that important software!
-
Post Reply