'-o', app_exe + '.html'
instead of '-o', app_exe + '.js'
in the top-level meson.build. This is sufficient to run any basic emscripten app.Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
So you need a HTTP server that allows specifying these.@LBPHacker?326511
Thank you very much. This is the second issue I've encountered.
I set up an HTTP server using Python 3, but when I visit, the webpage keeps hanging at "Loading...". All the test files I'm using are from https://trigraph.net/powdertoy/wasm.
(python3)
import http.server
import socketserver
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Cross-Origin-Opener-Policy", "same-origin")
self.send_header("Cross-Origin-Embedder-Policy", "require-corp")
super().end_headers()
HOST = '127.0.0.1'
PORT = 8000
with socketserver.TCPServer((HOST, PORT), MyHTTPRequestHandler) as server:
print(f"Server started at http://{HOST}:{PORT}")
server.serve_forever()
powderbeta.html:1 The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header.
powderbeta.js:619 Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined
at powderbeta.js:619:38
at powderbeta.html:45:56
@ powderbeta.js:619
@ powderbeta.html:45
Promise.then
@ powderbeta.html:45
@ powderbeta.html:56
powderbeta.html:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
I have enabled HTTPS, and now it works fine. Thank you very much for your help!!
Indeed it is.Is it possible to connect to the internet or access files stored in the same directory?