From b31f5d0546f166236f2c508a022c887e450e0d60 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sun, 16 Feb 2020 17:49:16 -0300 Subject: [PATCH] feat(splashscreen) inject tauri.js --- tauri/src/app/runner.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tauri/src/app/runner.rs b/tauri/src/app/runner.rs index 55ffbd269..de6103326 100644 --- a/tauri/src/app/runner.rs +++ b/tauri/src/app/runner.rs @@ -234,10 +234,10 @@ fn build_webview( .build()?; if has_splashscreen { - // trigger the init hook for the splashscreen since we're not injecting the tauri.js entry point - webview.handle().dispatch(|webview| { - webview.eval(r#"window.external.invoke(JSON.stringify({ cmd: "__initialized" }))"#) - }).expect("failed to initialize splashscreen"); + // inject the tauri.js entry point + webview + .handle() + .dispatch(|_webview| _webview.eval(include_str!(concat!(env!("TAURI_DIR"), "/tauri.js"))))?; } Ok(webview)