diff --git a/src/index.tsx b/src/index.tsx index 46baacb..8195c0d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -16,40 +16,49 @@ async function run() { const ReactDOM = await ReactDOMImport; const { toast, ToastContainer } = await Toastify; - const { - splits, - splitsKey, - layout, - hotkeys, - layoutWidth, - } = await LiveSplit.loadStoredData(); - try { - ReactDOM.render( -
- - -
, - document.getElementById("base"), - ); - } catch (_) { - alert(`Couldn't load LiveSplit One. \ + const { + splits, + splitsKey, + layout, + hotkeys, + layoutWidth, + } = await LiveSplit.loadStoredData(); + + try { + ReactDOM.render( +
+ + +
, + document.getElementById("base"), + ); + } catch (_) { + alert(`Couldn't load LiveSplit One. \ You may be using a browser that doesn't support WebAssembly. \ Alternatively, you may be using an Adblocker like uBlock Origin. \ Those are known to block WebAssembly.`); + } + } catch (e) { + if (e.name == "InvalidStateError") { + alert(`Couldn't load LiveSplit One. \ +You may be in private browsing mode. \ +LiveSplitOne cannot run in this mode. \ +To run LiveSplitOne, please disable private browsing in your settings.\n`); + } } }