* Add https://tauri.localhost for Windows
Fixes #878

* Comments and info logs
This commit is contained in:
Pierre Jacquier
2023-10-17 09:37:16 -04:00
committed by GitHub
parent 0aa2a6cee7
commit ce951d7c12

View File

@ -66,13 +66,16 @@ const initialise = async () => {
typeof window === 'undefined'
? 'http://127.0.0.1:3000'
: window.location.origin.includes('tauri://localhost')
? 'tauri://localhost'
? 'tauri://localhost' // custom protocol for macOS
: window.location.origin.includes('tauri.localhost')
? 'https://tauri.localhost' // fallback for Windows
: window.location.origin.includes('localhost')
? 'http://localhost:3000'
: window.location.origin && window.location.origin !== 'null'
? window.location.origin
: 'http://localhost:3000'
const fullUrl = baseUrl + '/wasm_lib_bg.wasm'
console.log(`Full URL for WASM: ${fullUrl}`)
const input = await fetch(fullUrl)
const buffer = await input.arrayBuffer()
return init(buffer)