feat: tweak debug tools to be customizable

This commit is contained in:
Jonathan Kelley committed 2022-02-21 23:45:01 -05:00
1 parent 1b3e865a5a
commit d19ae3ff56
2 files changed
+12 -4

No files matched your search

+4 -4
View File
@@ -172,10 +172,7 @@ pub fn launch_with_props<P: 'static + Send>(
webview = webview.with_custom_protocol(name, handler)
}
if cfg!(debug_assertions) {
// in debug, we are okay with the reload menu showing and dev tool
webview = webview.with_dev_tool(true);
} else {
if cfg.disable_context_menu {
// in release mode, we don't want to show the dev tool or reload menus
webview = webview.with_initialization_script(
r#"
@@ -192,6 +189,9 @@ pub fn launch_with_props<P: 'static + Send>(
}
"#,
)
} else {
// in debug, we are okay with the reload menu showing and dev tool
webview = webview.with_dev_tool(true);
}
desktop.webviews.insert(window_id, webview.build().unwrap());