Page 1 of 1
Surrogates stopped working 2.6.9.33
Posted: Fri Jul 31, 2015 1:42 pm
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 ....
Re: Surrogates stopped working 2.6.9.33
Posted: Fri Jul 31, 2015 4:50 pm
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
Re: Surrogates stopped working 2.6.9.33
Posted: Fri Jul 31, 2015 7:46 pm
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 :/
Re: Surrogates stopped working 2.6.9.33
Posted: Fri Jul 31, 2015 8:16 pm
by barbaz
Confirmed - note: not all surrogates are broken, just those that use $S are.
Re: Surrogates stopped working 2.6.9.33
Posted: Sat Aug 01, 2015 6:26 pm
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.
Re: Surrogates stopped working 2.6.9.33
Posted: Sun Aug 02, 2015 3:02 pm
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

Re: Surrogates stopped working 2.6.9.33
Posted: Sun Aug 02, 2015 5:15 pm
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.
Re: Surrogates stopped working 2.6.9.33
Posted: Sun Aug 02, 2015 8:14 pm
by Giorgio Maone
Re: Surrogates stopped working 2.6.9.33
Posted: Sun Aug 02, 2015 10:00 pm
by barbaz
Seems fixed, thanks
