Skip to content

Fetching JSON is blocked or return opaque answer #240

@lx78WyY0J5

Description

@lx78WyY0J5

Hi, recentrly i found this repo, the badge work when using in simple HTML,

But today i started to think about just grabing the JSON returned with some JS

The only way i could get an "answer" is by forcing 'NO-CORS' & CrossOrigin
But with this, it answer, but always an opaque "empty" response

I tested a LOT of way to fetch this .json that even my god damn browser show
But none either respond (blocked by cross-origine (while active) or by CORS), or they just respond this

Code :

    return new Promise(function (resolve, reject) {
        setTimeout(() => {
            fetch(url, {
                method: 'GET',
                crossorigin: true,
                mode: 'no-cors'
            })
                .then(response => console.log(response))
                .then(data => {
                    console.log(data);
                    return;
                })
                .catch(error => console.error(error))
        }, 1000);
    });
}
var global = await gather('https://hits.dwyl.com/abc/abc');  

Response
chrome_AlldM4NqMI


Edit : I tested it also with realTime page & console (to avoid running script from local IP 127.0.0.1...)
But same behavior


cURL work well and give me the raw JSON as answer after hitting cloudflare,


Forgot to mention that else, everything work perfectly 🤡 😢
Thx BTW for repo :octocat:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions