improve SharedArrayBuffer error message (fix #91)
This commit is contained in:
parent
e74d20a60a
commit
87a0471225
19
index.html
19
index.html
@ -163,20 +163,23 @@ __ __ _ __ ____ __
|
|||||||
},
|
},
|
||||||
getSharedArrayBufferMissingMessage: function ()
|
getSharedArrayBufferMissingMessage: function ()
|
||||||
{
|
{
|
||||||
|
const isCustom = window.location.hostname !== "webvm.io";
|
||||||
|
const isSecureContext = window.isSecureContext;
|
||||||
const text = [
|
const text = [
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
color + "CheerpX could not start" + normal,
|
color + "CheerpX could not start" + normal,
|
||||||
"",
|
"",
|
||||||
"CheerpX depends on JavaScript's SharedArrayBuffer, that your browser",
|
"CheerpX uses SharedArrayBuffer, which is not available right now.",
|
||||||
" does not support.",
|
|
||||||
"",
|
"",
|
||||||
"SharedArrayBuffer is currently enabled by default on recent",
|
!isSecureContext && " - This page is not in a secure context. Serve over HTTPS or WSS.",
|
||||||
" versions of Chrome, Edge, Firefox and Safari.",
|
!isSecureContext && " " + underline + "https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts" + noral,
|
||||||
"",
|
isCustom && " - The document is not cross-origin isolated.",
|
||||||
"",
|
isCustom && " " + underline + "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements" + normal,
|
||||||
"Give it a try from another browser!",
|
" - Your browser might not support SharedArrayBuffer.",
|
||||||
]
|
" Since 2022, all major browsers support this feature.",
|
||||||
|
" " + underline + "https://caniuse.com/sharedarraybuffer" + normal,
|
||||||
|
].filter(Boolean);
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user