@@ -0,0 +1,5 @@
+---
+"tauri": patch:enhance
+
+Added `tauri::dev()` to determine whether we are running in development mode or not.
@@ -333,6 +333,11 @@ macro_rules! tauri_build_context {
pub use pattern::Pattern;
+/// Whether we are running in development mode or not.
+pub fn dev() -> bool {
+ !cfg!(feature = "custom-protocol")
+}
/// User supplied data required inside of a Tauri application.
///
/// # Stability
@@ -320,7 +320,7 @@ impl<R: Runtime> AppManager<R> {
}
fn csp(&self) -> Option<Csp> {
- if cfg!(feature = "custom-protocol") {
+ if !crate::dev() {
self.config.app.security.csp.clone()
} else {
self