Skip to content

Commit

Permalink
feat: enable devtools in debug mode by default (#741)
Browse files Browse the repository at this point in the history
* feat: enable devtools in debug mode by default

* fix docs
  • Loading branch information
amrbashir committed Oct 27, 2022
1 parent 569057a commit fea0638
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/devtools-debug-mode.md
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

Enabled devtools in debug mode by default.
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -56,7 +56,7 @@
//! This feature requires either `libayatana-appindicator` or `libappindicator` package installed.
//! You can still create those types if you disable it. They just don't create the actual objects.
//! - `devtools`: Enables devtools on release builds. Devtools are always enabled in debug builds.
//! On **macOS**, enabling devtools, requires calling private apis so you should enabling this flag in release
//! On **macOS**, enabling devtools, requires calling private apis so you should not enable this flag in release
//! build if your app needs to publish to App Store.
//! - `transparent`: Transparent background on **macOS** requires calling private functions.
//! Avoid this in release build if your app needs to publish to App Store.
Expand Down
5 changes: 4 additions & 1 deletion src/webview/mod.rs
Expand Up @@ -235,6 +235,9 @@ impl Default for WebViewAttributes {
download_completed_handler: None,
new_window_req_handler: None,
clipboard: false,
#[cfg(debug_assertions)]
devtools: true,
#[cfg(not(debug_assertions))]
devtools: false,
zoom_hotkeys_enabled: false,
accept_first_mouse: false,
Expand Down Expand Up @@ -439,7 +442,7 @@ impl<'a> WebViewBuilder<'a> {
self
}

/// Enable web inspector which is usually called dev tool.
/// Enable or disable web inspector which is usually called dev tool.
///
/// Note this only enables dev tool to the webview. To open it, you can call
/// [`WebView::open_devtools`], or right click the page and open it from the context menu.
Expand Down

0 comments on commit fea0638

Please sign in to comment.