jasonbio / reddit-shell

web based linux shell emulator that allows you to browse reddit via command line
https://redditshell.com/
GNU General Public License v3.0
432 stars 38 forks source link

Fetching error #7

Closed asadw1 closed 8 years ago

asadw1 commented 8 years ago

As per the Twitter convo, I've got a screenshot of some commands I tried with the fetching data error.

Noticed that string displaying the fetch error message in the setTimeout calls between large if-blocks such as line 134 here has anything to do with it: https://github.com/jasonbio/reddit-shell/blob/master/js/redditshell.js

fetch

jasonbio commented 8 years ago

I'm wondering if this just has to do with reddit being under heavy load at the time of your request. I just tried these commands and they both work for me.

Try hitting the reddit's endpoint directly at https://www.reddit.com/r/askreddit/.json and see if you get a specific error maybe

asadw1 commented 8 years ago

If by hitting the endpoint you mean directly accessing the mentioned link in-browser, just tried that and it looks like the .json file loaded normally; just minified the way I've seen CSS or big js scripts. You could be right about load however

jasonbio commented 8 years ago

Can you get the specific error code the request makes in your browser console? This will tell you what kind of response reddit is sending back. Does it happen with every subreddit every time you request or have you seen it go through before?

asadw1 commented 8 years ago

Tried "list askreddit" command again.

Grabbed this from my console: The resource at "https://www.reddit.com/r/askreddit/.json?limit=9&jsonp=jQuery17106764386307889276_1452201000560&_=1452201912293" was blocked because tracking protection is enabled.

Dug a little bit and it's related to a new Firefox policy that adds tracking protection: https://developer.mozilla.org/en-US/Firefox/Privacy/Tracking_Protection

I can try this incognito in Chrome to see if its local to the browser

asadw1 commented 8 years ago

Yup, loads successfully in Chrome. Stupid FF xD

jasonbio commented 8 years ago

Interesting.. so this only happens when using Private Browsing in FireFox. From what I'm seeing, there isn't a way to circumvent this. Lame.

asadw1 commented 8 years ago

Only by locally disabling tracking policy it's possible: https://stackoverflow.com/questions/33668378/the-resource-at-http-some-urls-some-files-js-was-blocked-because-tracking-pr/34665718#34665718

Not sure if there's a way on the reddit shell side (configs or otherwise) to get the callbacks to play nicely with the new policy.

jasonbio commented 8 years ago

Doesn't look like it. Might have to just call it out in the README for now. Anyways, thanks for the report :) :+1: