Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Fetching a game's page with javascript's fetch returns 200 but still errors

A topic by Nick created Nov 06, 2023 Views: 326 Replies: 5
Viewing posts 1 to 3

I was trying to make a userscript to filter out more than one tag at once with ?exclude= but i ran into this error:

If this is intended behaviour and fetch shouldn't be able to GET a game's page from the https://itch.io/games origin then why is it returning 200?
This is the code:

let gameLinks = document.querySelectorAll(`[class="thumb_link game_link"]`);
fetch(gameLinks[0].href).then(res => console.log(res));

image isn't showing up on firefox but is there when i try and edit the post so i'll just add an imgur link to it just to be safe: https://imgur.com/bDBl3Oo

Admin(+1)

The header is a CORS header enforced by the browser, it is independent from the server’s response code (200). The page would need to have CORS enabling headers for you to be able to perform that request in the browser.

(1 edit)

I've googled myself blind at this point and it still doesn't work, tried it with mode: 'cors' too, nothing


Admin

Sorry for not being clear, there is no way to do what you’re trying directly in the browser because we do not make the game pages available for fetching cross domain.

Ah, I see. 
Getting slightly off topic now and I don't know if you're informed on this at all but do you have any info on why filtering hasn't been implemented?
It's been 6+ years now and aside from the ?exclude= thing people have consistently asked about it pretty much every year since. Does the backend just not support it? Is it low priority?

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.