QuantumBadger / RedReader

An unofficial open source Android app for Reddit.
GNU General Public License v3.0
2k stars 484 forks source link

Twitter special treatment #602

Open lol768 opened 6 years ago

lol768 commented 6 years ago

Twitter's mobile site seems to be awful. Most of the time when opening reddit links to twitter, the first page load fails with a "You are not authorised to view these tweets" or "Twitter took too long to respond". Refreshes sometimes fix the issue. I've managed to reproduce this on a desktop by hitting mobile.twitter.com with the User-Agent and X-Requested-With headers set to the same as RedReader. Looking at the network console, the https://api.twitter.com/2/timeline/conversation/$id.json call literally just hangs.

This is undoubtedly a Twitter issue and - if I were to put my tin-foil hat on - is perhaps deliberate to encourage people to use the app rather than the mobile site.

It would be nice if RedReader could work around this by:

QuantumBadger commented 6 years ago

Thanks for the info!

enable desktop UA spoofing

This sounds easy enough, and may be sufficient.

suppressing the X-Requested-With header

I've been reading around and it sounds like this isn't possible using the Android WebView -- even if you manage to disable this for the main page load, all the ancillary resources (CSS, AJAX, etc) still has the header added:

https://www.stoutner.com/the-x-requested-with-header/

One workaround may be to use an external browser for Twitter links. I'd suggest that we use the Twitter API to load tweets directly, although I've heard nothing but takes of woe about it.

If only everyone would switch to Mastodon ;)

crud3 commented 5 years ago

Are there any reasons (besides privacy and related issues) for not opening Twitter links in the external browser / Twitter app, or giving the option to do so?

I was also annoyed by the Twitter mobile site in the internal browser, so I added a preference in the behavior section to always open Twitter posts externally. I totally understand why this may not be wanted upstream, e.g., limiting the number of preferences etc. It is also just a quick and dirty solution for my personal usage right now.

Desktop UA spoofing and suppressing the X-Requested-With header are also interesting options, I might look into that if I have some spare time.