mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
better solution
This commit is contained in:
parent
82077e2e23
commit
6d36b2a796
@ -167,8 +167,8 @@ private struct CallView: UIViewRepresentable {
|
|||||||
// MARK: - WKUIDelegate
|
// MARK: - WKUIDelegate
|
||||||
|
|
||||||
func webView(_ webView: WKWebView, decideMediaCapturePermissionsFor origin: WKSecurityOrigin, initiatedBy frame: WKFrameInfo, type: WKMediaCaptureType) async -> WKPermissionDecision {
|
func webView(_ webView: WKWebView, decideMediaCapturePermissionsFor origin: WKSecurityOrigin, initiatedBy frame: WKFrameInfo, type: WKMediaCaptureType) async -> WKPermissionDecision {
|
||||||
// If we are using the local url, we allow the camera and microphone, otherwise we need to verify that the host matches the one from the provided URL.
|
// Allow if the origin is local, otherwise don't allow permissions for domains different than what the call was started on
|
||||||
guard url.isFileURL || origin.host == url.host else {
|
guard origin.protocol == "file" || origin.host == url.host else {
|
||||||
return .deny
|
return .deny
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user