I have a website made with sveltekit and I want to add a flappy bird made with godot 4, when I export the game and upload it to itch.io the game runs and runs fine, but when I use an iframe to run my game on my website, I get this message:
Error
The following features required to run Godot projects on the Web are missing:
Cross Origin Isolation – Check web server configuration (send correct headers)
SharedArrayBuffer – Check web server configuration (send correct headers)
I asked ChatGPT and he told me to put these headers in my vite.config.ts:
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp'
}
}
But I still have the same problem, I also tried to run my game locally on my website and it’s still the same so I tried to run it from an itch.io iframe again, this is the code I’m using to run it:
<script>
export let src = 'https://html.itch.zone/html/11009302/index.html';
export let width = "800";
export let height = "600";
</script>
<iframe
src={src}
width={width}
height={height}
class="border-none"
style="border: none; display: block; margin: auto;"
title=""
></iframe>
<style>
iframe {
display: block;
margin: auto;
}
</style>
I want my game that I published on itch.io to run on my website with iframe as well, but I get this error:
Error
The following features required to run Godot projects on the Web are missing:
Cross Origin Isolation – Check web server configuration (send correct headers)
SharedArrayBuffer – Check web server configuration (send correct headers)
If it can’t be done from itch.io and the game has to be local from my website, nothing happens, but I also tried that and I get the same error.