Page 1 of 1

[DONE] Twitter surrogate update needed

Posted: Wed Nov 19, 2014 1:41 pm
by ozjuggler
Hey all,
I encountered a site which didn't work while blocking twitter. The current NoScript surrogate wasn't enough, so I tried to improve it.
The site referred to twttr.widgets.load(), but didn't do anything with the resulting widgets, so that function call can be stubbed out with a null result.
Here is my alternate surrogate replacement for twitter.

Code: Select all

twttr=(function(){var f=arguments.callee; var ro = f.__noSuchMethod__=f.events=f.anywhere=f; ro.widgets={load:function(){} }; return ro})();
With this addition the site worked okay while blocking twitter.

Re: Misc Surrogate Scripts Discussion

Posted: Thu Nov 20, 2014 7:50 pm
by barbaz
Thanks! I'd suggest the following tweak though

Code: Select all

twttr=(function(){var f=arguments.callee; var ro = f.__noSuchMethod__=f.events=f.anywhere=f; ro.widgets={__noSuchMethod__:function(){}}; return ro})();
so that it's not as likely to need updating.

Splitting into a new topic so that it's more visible.

Re: [DONE] Twitter surrogate update needed

Posted: Fri Dec 05, 2014 11:33 am
by ozjuggler
v 2.6.9.5
=============================================================
...
x Updated Twitter surrogate (thanks ozjuggler and barbaz)
...
Thank you, fans, *sniff*, thank you.
I'm honoured to accept this award, but really, it was a team effort.