From f10b520a373df7d3f69fb01ae428a323c8ab93a5 Mon Sep 17 00:00:00 2001 From: "ossun.l" Date: Thu, 27 Jun 2024 11:43:51 +0900 Subject: [PATCH] =?UTF-8?q?webView=E3=81=AE=E6=A8=A9=E9=99=90=E7=A2=BA?= =?UTF-8?q?=E8=AA=8D=E3=82=92Native=E3=81=8B=E3=82=89=E7=B6=99=E6=89=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m b/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m index d3ec070d4..f4655d048 100644 --- a/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m +++ b/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m @@ -174,7 +174,12 @@ - (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(non decision = WKPermissionDecisionGrant; } else { - if ([origin.host isEqualToString:webView.URL.host]) { + NSLog(@"origin.protocol host webView.URL.host %@ %@ %@", origin.protocol, origin.host, webView.URL.host); + if ([origin.protocol isEqualToString:@"file"]) { + NSLog(@"Supressing media permission request for file origin"); + decision = WKPermissionDecisionGrant; + } + else if ([origin.host isEqualToString:webView.URL.host]) { decision = WKPermissionDecisionGrant; } else {