From 3a587c41d600e382f5f3ec2e2009c2e13d9fa95a Mon Sep 17 00:00:00 2001 From: Daniel Jacobs Date: Tue, 16 Jul 2024 23:43:15 -0400 Subject: [PATCH] web: Check error type instead of error message --- web/packages/core/src/ruffle-player.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/web/packages/core/src/ruffle-player.tsx b/web/packages/core/src/ruffle-player.tsx index 2ec557a9d2c9e..cde0c6f6a131e 100644 --- a/web/packages/core/src/ruffle-player.tsx +++ b/web/packages/core/src/ruffle-player.tsx @@ -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) {