From 0ca7bc374ef40c6832025faf157b7b35eaf542dd Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Tue, 29 Sep 2020 12:50:08 +0200 Subject: [PATCH] Add COOP/COEP headers to HTML5 "run" server. This allow the page to be considered a SecureContext if the address is localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions) enable extra features needed for the HTML5 threaded export. --- platform/javascript/export/export.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 73f6f58c413..c1df83fc2d5 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -124,6 +124,9 @@ public: String s = "HTTP/1.1 200 OK\r\n"; s += "Connection: Close\r\n"; s += "Content-Type: " + ctype + "\r\n"; + s += "Access-Control-Allow-Origin: *\r\n"; + s += "Cross-Origin-Opener-Policy: same-origin\r\n"; + s += "Cross-Origin-Embedder-Policy: require-corp\r\n"; s += "\r\n"; CharString cs = s.utf8(); Error err = connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1);