23 lines
767 B
Rust
23 lines
767 B
Rust
use tauri::{WebviewUrl, WebviewWindowBuilder};
|
|
|
|
pub fn context<R: tauri::Runtime>() -> tauri::Context<R> {
|
|
tauri::generate_context!()
|
|
}
|
|
|
|
pub fn builder() -> tauri::Builder<tauri::Wry> {
|
|
tauri::Builder::default().setup(|app| {
|
|
WebviewWindowBuilder::new(app, "launcher", WebviewUrl::App("index.html".into()))
|
|
.use_https_scheme(true)
|
|
.on_navigation(|url| {
|
|
url.scheme() == "https"
|
|
&& url.host_str() == Some("tauri.localhost")
|
|
&& url.port().is_none()
|
|
&& url.username().is_empty()
|
|
&& url.password().is_none()
|
|
&& matches!(url.path(), "/" | "/index.html")
|
|
})
|
|
.build()?;
|
|
Ok(())
|
|
})
|
|
}
|