[DONE] Twitter surrogate update needed

Proposals for new surrogate scripts, updates/bug fixes to existing ones, tips and tricks to work around the lazy web.
Post Reply
ozjuggler
Posts: 5
Joined: Sun Sep 28, 2014 2:32 am

[DONE] Twitter surrogate update needed

Post 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.
Last edited by barbaz on Sun Nov 23, 2014 3:20 am, edited 2 times in total.
Reason: Done in 2.6.9.5rc2
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: Misc Surrogate Scripts Discussion

Post 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.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; U; FreeBSD amd64; en-us) AppleWebKit/531.2 (KHTML, like Gecko) Safari/531.2 Epiphany/2.30.0
ozjuggler
Posts: 5
Joined: Sun Sep 28, 2014 2:32 am

Re: [DONE] Twitter surrogate update needed

Post 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.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Post Reply