connorjclark / ZeldaClassic

Zelda Classic is a game and editing tool that let you create custom Legend of Zelda quests.
http://zeldaclassic.com/
GNU General Public License v3.0
48 stars 1 forks source link

Zelda Port not embeddable #2

Closed AT3META closed 1 year ago

AT3META commented 2 years ago

Hello, I've tried to port the Zelda game through my website. It hangs and doesn't initialize. Any thoughts? It is an attempt to embed the Zelda Port to an installation of OSSN 5.6. Many thanks! ZeldaPorting

connorjclark commented 2 years ago

Any errors in the browser console?

AT3META commented 1 year ago

image Uncaught ReferenceError: SharedArrayBuffer is not defined at zelda.js:1:12920

connorjclark commented 1 year ago

You need to set two response headers for your page:

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

I was surprised to find this would be necessary for the page embedding the iframe, but apparently it is. my website serves these headers because they are necessary to enable certain higher-risk JS apis.

AT3META commented 1 year ago

Here is my code for the page. Can you suggest where to put this recommendation? Many thanks!

image

connorjclark commented 1 year ago

Sorry, I can't. You need to configure your webserver to add the correct headers.

Good luck!

connorjclark commented 1 year ago

FYI, new web feature is landing in Chrome soon to avoid this COEP problem when embedding third-party iframes that you don't need special access to.

https://bugs.chromium.org/p/chromium/issues/detail?id=1226469 https://github.com/camillelamy/explainers/blob/main/anonymous_iframes.md

<iframe src=example.com credentials=omit>

I think currently it is behind a chrome flag AnonymousIframe.