Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Can't Embed into <iframe> (SharedArrayBuffer)

A topic by louislugas created Nov 15, 2023 Views: 1,222 Replies: 3
Viewing posts 1 to 3
(+1)

I tried to make a game with Godot 4 and export it to HTML following this video tutorial. It works as shown on this page. It's told that you have to check the SharedArrayBuffer option, to make it work, or it will show an error. Then I want to embed the game in an iframe on my own web, unfortunately, the error that is supposed to show if you uncheck the SharedArrayBuffer option, appears when it's embedded in the iframe. From my widget page, the preview is not working, it shows:

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 think the problem is (maybe) in the iframe because the direct link is working.

Pinned ReplyAdmin (1 edit) (+1)

In order for the required headers to function every single embedding page must have compatible headers. This means that on your site the contains the iframe you will have to provide the following (or compatible) headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Unfortunately this may be impossible or complicated depending on the host. This is why we recommend using a link to open the game in a new tab or window, instead of embedding it into the page.

Don't pay too much attention to me because I'm not a web developer.

But what I understand.

In order to use the "SharedArrayBuffer" it is necessary to configure certain headers on the server side, to prevent external services from accessing the Buffer and stealing information.

The problem is that the game can only run if it is on that server, in this case on Itch.io.

If you need to access the game from another server (not a client, but an iframe), I understand that your own external website. It is necessary to configure "Cross Origin Isolation" in order to avoid any attack that could steal information from the buffer.

How to configure "Cross Origin Isolation"?

I do not have the slightest idea. But it is something that must be done at the server level, that is, not the programming of your game, but on the server where your website is and/or in Itch.

(+1)

I see, while is not solving the problem, but it gave insight to me and others who read this. I hope somebody can give me solution on this. Thanks anyway.

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