ubershmekel / redditp

Convert any reddit page to a presentation or slide show
https://redditp.com
MIT License
261 stars 102 forks source link

future compatibility issues with chrome (CORB - Cross Origin Request Blocking) #104

Closed smarek closed 4 years ago

smarek commented 4 years ago
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://www.reddit.com/.json?jsonp=&callback=jQuery341001758306891861272_1581445509419&_=1581445509420 with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

Accessing redditp from localhost (local nginx, redditp.local domain), will fail if ajax is run like this

// script.js func getRedditImages
        $.ajax({
            url: jsonUrl,
            dataType: 'jsonp',
            success: handleData,
            error: failedAjax,
            404: failedAjax,
            timeout: 5000
        });

Changing jsonp to json solves the issue

ubershmekel commented 4 years ago

Thank you @smarek

ubershmekel commented 4 years ago

Seems this failed to load with a CORS JSON request but it does work with jsonp. http://www.reddit.com/r/randnsfw/top.json?&t=all

I'm reverting the change to CORS until I know more about what's going on there.