web: Add specific error message for disabled WASM on Microsoft Edge (#6423)
* web: Add specific error message for disabled WASM on Microsoft Edge Related to #6395 * web: Update Microsoft Edge WASM error message conditional Co-Authored-By: Daniel Jacobs <danielhunterjacobs@gmail.com> * web: Update "More Information" link for Microsoft Edge WASM error Co-authored-by: Daniel Jacobs <danielhunterjacobs@gmail.com>
This commit is contained in:
parent
697ad92db5
commit
355bd35935
|
@ -38,6 +38,7 @@ const enum PanicError {
|
||||||
WasmDownload,
|
WasmDownload,
|
||||||
WasmMimeType,
|
WasmMimeType,
|
||||||
WasmNotFound,
|
WasmNotFound,
|
||||||
|
WasmDisabledMicrosoftEdge,
|
||||||
SwfFetchError,
|
SwfFetchError,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,6 +418,12 @@ export class RufflePlayer extends HTMLElement {
|
||||||
e.ruffleIndexError = PanicError.WasmDownload;
|
e.ruffleIndexError = PanicError.WasmDownload;
|
||||||
} else if (e.name === "TypeError") {
|
} else if (e.name === "TypeError") {
|
||||||
e.ruffleIndexError = PanicError.JavascriptConflict;
|
e.ruffleIndexError = PanicError.JavascriptConflict;
|
||||||
|
} else if (
|
||||||
|
navigator.userAgent.includes("Edg") &&
|
||||||
|
message.includes("webassembly is not defined")
|
||||||
|
) {
|
||||||
|
// Microsoft Edge detection.
|
||||||
|
e.ruffleIndexError = PanicError.WasmDisabledMicrosoftEdge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.panic(e);
|
this.panic(e);
|
||||||
|
@ -1244,6 +1251,20 @@ export class RufflePlayer extends HTMLElement {
|
||||||
<li><a href="#" id="panic-view-details">View Error Details</a></li>
|
<li><a href="#" id="panic-view-details">View Error Details</a></li>
|
||||||
`;
|
`;
|
||||||
break;
|
break;
|
||||||
|
case PanicError.WasmDisabledMicrosoftEdge:
|
||||||
|
// Self hosted: User has disabled WebAssembly in Microsoft Edge through the
|
||||||
|
// "Enhance your Security on the web" setting.
|
||||||
|
errorBody = `
|
||||||
|
<p>Ruffle failed to load the required ".wasm" file component.</p>
|
||||||
|
<p>To fix this, try opening your browser's settings, clicking "Privacy, search, and services", scrolling down, and turning off "Enhance your security on the web".</p>
|
||||||
|
<p>This will allow your browser to load the required ".wasm" files.</p>
|
||||||
|
<p>If the issue persists, you might have to use a different browser.</p>
|
||||||
|
`;
|
||||||
|
errorFooter = `
|
||||||
|
<li><a target="_top" href="https://github.com/ruffle-rs/ruffle/wiki/Frequently-Asked-Questions-For-Users#edge-webassembly-error">More Information</a></li>
|
||||||
|
<li><a href="#" id="panic-view-details">View Error Details</a></li>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
case PanicError.JavascriptConflict:
|
case PanicError.JavascriptConflict:
|
||||||
// Self hosted: Cannot load `.wasm` file - a native object / function is overriden
|
// Self hosted: Cannot load `.wasm` file - a native object / function is overriden
|
||||||
errorBody = `
|
errorBody = `
|
||||||
|
|
Loading…
Reference in New Issue