()
| 30 | * everything else lazily inits on first use. |
| 31 | */ |
| 32 | export function initRustCore(): Promise<void> { |
| 33 | if (!initPromise) { |
| 34 | initPromise = (async (): Promise<void> => { |
| 35 | const wasmUrl = (browser.runtime.getURL as (path: string) => string)('src/aliasvault_core_bg.wasm'); |
| 36 | const wasmBytes = await (await fetch(wasmUrl)).arrayBuffer(); |
| 37 | await initWasm(wasmBytes); |
| 38 | })(); |
| 39 | } |
| 40 | return initPromise; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Extract the host (subdomain + domain) from a URL. |
no outgoing calls
no test coverage detected