You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,8 @@
39
39
max-width:8rem;
40
40
}
41
41
42
-
.not-hosted-msg {
42
+
.not-hosted-msg,
43
+
.no-coi-msg {
43
44
text-align: center;
44
45
position: absolute;
45
46
@@ -87,6 +88,7 @@
87
88
88
89
const{ protocol }=window.location;
89
90
constisHosted=protocol!=="file:";
91
+
constisCOI=crossOriginIsolated??false;
90
92
letraylibJs=undefined;
91
93
92
94
functionstartRaylib(selectedWasm){
@@ -96,6 +98,21 @@
96
98
raylibExampleSelect.value=selectedWasm;
97
99
98
100
if(isHosted){
101
+
if(!isCOI){
102
+
window.addEventListener("load",()=>{
103
+
document.body.innerHTML=`
104
+
<div class="no-coi-msg">
105
+
<div class="important">
106
+
<p>Unfortunately, due to security restrictions, <code>SharedArrayBuffer</code> cannot be used.</p>
107
+
<p>Please navigate to this location using a web server that has the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements">required headers set</a>.</p>
108
+
<p>If you have Python 3 on your system you can just do:</p>
109
+
</div>
110
+
<code>$ python3 ./server.py 6969</code>
111
+
</div>
112
+
`;
113
+
});
114
+
return;
115
+
}
99
116
if(raylibJs!==undefined){
100
117
raylibJs.stop();
101
118
}
@@ -113,7 +130,7 @@
113
130
<p>Please navigate to this location using a web server.</p>
114
131
<p>If you have Python 3 on your system you can just do:</p>
0 commit comments