web: Check error type instead of error message

This commit is contained in:
Daniel Jacobs 2024-07-16 23:43:15 -04:00 committed by Nathan Adams
parent befe226f4a
commit 579d2ff2b7
1 changed files with 1 additions and 4 deletions

View File

@ -1973,10 +1973,7 @@ export class RufflePlayer extends HTMLElement {
) {
// Firefox: Don't display the panic screen if the user leaves the page while something is still loading
return;
} else if (
error instanceof Error &&
error.message === "Failed to load Ruffle WASM"
) {
} else if (error instanceof LoadRuffleWasmError) {
const openInNewTab = this.loadedConfig?.openInNewTab;
const swfUrl = this.loadedConfig && "url" in this.loadedConfig ? new URL(this.loadedConfig.url, document.baseURI) : undefined;
if (openInNewTab && swfUrl) {