From ae64a09383e7742d790e04cc5de32e52f31f503c Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Mon, 11 Mar 2024 20:00:54 +0800 Subject: [PATCH] fix(mac): suppress duplicated media permission prompt (#1186) --- src/wkwebview/mod.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs index 7a95de782..06bda840f 100644 --- a/src/wkwebview/mod.rs +++ b/src/wkwebview/mod.rs @@ -804,16 +804,10 @@ impl InnerWebView { run_file_upload_panel as extern "C" fn(&Object, Sel, id, id, id, id), ); - // Only disable media dialogs on macOS < 14.0 - // https://tauri.app/v1/references/webview-versions/ - let webview_system_version = platform_webview_system_version()?.parse::(); - if webview_system_version.is_err() || webview_system_version.unwrap() < 19 { - // Disable media dialogs - ctl.add_method( - sel!(webView:requestMediaCapturePermissionForOrigin:initiatedByFrame:type:decisionHandler:), - request_media_capture_permission as extern "C" fn(&Object, Sel, id, id, id, id, id), - ); - } + ctl.add_method( + sel!(webView:requestMediaCapturePermissionForOrigin:initiatedByFrame:type:decisionHandler:), + request_media_capture_permission as extern "C" fn(&Object, Sel, id, id, id, id, id), + ); ctl.register() }