CI: Use coi-serviceworker for Cross-origin isolation on gh-pages

https://github.com/gzuidhof/coi-serviceworker
This commit is contained in:
Reinhold Gschweicher 2022-03-31 22:44:31 +02:00
parent 0febb00f2b
commit 99a5c95c93
1 changed files with 4 additions and 0 deletions

View File

@ -68,10 +68,14 @@ jobs:
build_em/infinisim.js
build_em/infinisim.wasm
# using https://github.com/gzuidhof/coi-serviceworker to get Cross-origin isolation on gh-pages
# otherwise the error 'Uncaught ReferenceError: SharedArrayBuffer is not defined' will be shown
- name: Prepare Github Page
shell: bash
run: |
mkdir emscripten
curl -o emscripten/coi-serviceworker.js https://raw.githubusercontent.com/gzuidhof/coi-serviceworker/ed2fbe98a222b8e0991a839f504137408d56d2e6/coi-serviceworker.js
sed -i -e 's#</body>#<script src="coi-serviceworker.js"></script></body>#' build_em/infinisim.html
mv build_em/infinisim.html \
build_em/infinisim.js \
build_em/infinisim.wasm \