diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1bc557f..f593931 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -28,3 +28,5 @@ default = [ "custom-protocol" ] # this feature is used used for production builds where `devPath` points to the filesystem # DO NOT remove this custom-protocol = [ "tauri/custom-protocol" ] +# Enable DevTools for debugging. +devtools = [] diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index af3ce31..1280e26 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -74,14 +74,17 @@ fn main() -> wry::Result<()> { } }; - let _webview = WebViewBuilder::new(window)? + let webview = WebViewBuilder::new(window)? .with_url(&url.to_string())? - // .with_devtools(true) + .with_devtools(cfg!(feature = "devtools")) .with_initialization_script(include_str!("pake.js")) .with_ipc_handler(handler) .build()?; - // _webview.open_devtools(); + #[cfg(feature = "devtools")] { + webview.open_devtools(); + } + event_loop.run(move |event, _, control_flow| { *control_flow = ControlFlow::Wait; @@ -97,7 +100,7 @@ fn main() -> wry::Result<()> { .. } => { if menu_id == close_item.clone().id() { - _webview.window().set_minimized(true); + webview.window().set_minimized(true); } println!("Clicked on {:?}", menu_id); }