CORS issue with Firefox and fetch

Game development with Board Game Arena Studio
Post Reply
User avatar
snugglecactus
Posts: 7
Joined: 16 August 2023, 07:06

CORS issue with Firefox and fetch

Post by snugglecactus »

Firefox won't let me `fetch` an asset from g_gamethemeurl. See the following error:

Security Error: Content at https://studio.boardgamearena.com/1/skipto?table=533414 may not load data from https://studio.boardgamearena.com:8084/ ... /icons.svg.

I've verified the URL is valid.

Then I tried using `credentials: "include"` with the fetch call, but get this error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘https://studio.boardgamearena.com:8084/ ... /icons.svg’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’).

This is not an issue on Chrome or Safari. Tested with Firefox 120.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: CORS issue with Firefox and fetch

Post by Tisaac »

snugglecactus wrote: 25 November 2023, 20:53 Firefox won't let me `fetch` an asset from g_gamethemeurl. See the following error:

Security Error: Content at https://studio.boardgamearena.com/1/skipto?table=533414 may not load data from https://studio.boardgamearena.com:8084/ ... /icons.svg.

I've verified the URL is valid.

Then I tried using `credentials: "include"` with the fetch call, but get this error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘https://studio.boardgamearena.com:8084/ ... /icons.svg’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’).

This is not an issue on Chrome or Safari. Tested with Firefox 120.
What are you trying to achieve ?
User avatar
snugglecactus
Posts: 7
Joined: 16 August 2023, 07:06

Re: CORS issue with Firefox and fetch

Post by snugglecactus »

Sorry for the late reply. All I'm trying to do is use a `.svg` file as a sprite sheet, but the 'Content-Security-Policy' is not allowing me to load the svg file at `https://studio.boardgamearena.com:8084` when the web page is loaded from `https://studio.boardgamearena.com` (note the lack of a port number).

This issue occurs in Firefox specifically. Chrome and Safari work fine.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: CORS issue with Firefox and fetch

Post by Tisaac »

snugglecactus wrote: 02 January 2024, 18:44 Sorry for the late reply. All I'm trying to do is use a `.svg` file as a sprite sheet, but the 'Content-Security-Policy' is not allowing me to load the svg file at `https://studio.boardgamearena.com:8084` when the web page is loaded from `https://studio.boardgamearena.com` (note the lack of a port number).

This issue occurs in Firefox specifically. Chrome and Safari work fine.
Then i am afraid you wont be able to do it that way. Only way to access svg content is to embed it directly inside the tpl (or create it from je by having ite content in a js file)
Post Reply

Return to “Developers”