Skip to content

Commit

Permalink
webViewの権限確認をNativeから継承
Browse files Browse the repository at this point in the history
  • Loading branch information
sonlichao committed Jun 27, 2024
1 parent c12cab2 commit f10b520
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f10b520

Please sign in to comment.