#is getDisplayMedia still unavailable in WKWebView?
1 messages · Page 1 of 1 (latest)
I'm seeing that this was fixed in Ventura. Still hitting the permissions issue. Maybe the question should be how to reset user permissions on a Tuari app
WKWebView doesn't have a GUI. It expects the application to handle all permission requests that require user input since different apps have different visual styles.
As an example, when you do the same in Chrome and Firefox, you will see two different visual styles for the permission prompts.
Tauri hasn't registered a listener for WKWebView to send the permission request to. WKWebView considers this a rejection by default. Tauri faces the same challenge as WKWebView does: giving developers the ability to style the prompt as they wish while also considering that developers shouldn't be able to disguise the prompt; they're a user-facing permission prompt to protect the user's privacy, after all.
Understood. So how do we request that permission be available? I know webkit doesn't support navigator.permissions.query for screen capture
Or is this a case of, it's no longer a WKWebView issue and now a Tauri issue? Or is there a way to request this perm that I'm not getting
It's a Tauri DX problem with a work-around of implementing the permissions handling yourself using with_webview.
Gotcha. Are there any examples of anyone doing this kind of thing? Not even for getDisplayMedia but any permissions?
None that I know of. Unfortunately, macOS isn't an area I'm very familiar with but the interaction is through the cocoa library so that's your best bet for documentation.
Ok, I'll paw around, thank you for your time. Hopefully I can find a public repo where someone is requesting something here. But will also dive into the cocoa library docs posted.
If I get anything working, I'll put it in a blog post
That would be great. If you'd like, you can share the blog post in #1047149172144492604 and add it to the Awesome Tauri repository.
Sadly not making a ton of progress. It's wild how MacOS will prompt you for perms when it needs anything, but with getDisplayMedia it won't. I guess i'll be diving in much deeper to Core Foundation
getDisplayMedia requiring permission is a W3C standard, not Apple's macOS security policies.
I suspect they implemented it this way because all the browser GUIs had different styles.
oh right, yeah I got a bit lost in the sauce here.
Sadly I can figure out how to trigger the dialog from with_webview, so I might have to port to Electron 😦
Small update to this.
It seems like MacOS v14 is not prompting, but v13 is prompting. We'll wait for it to be a full release but maybe something interesting here
do you find anything else to this issue @slate wagon ?
https://github.com/tauri-apps/tauri/issues/2600 is the latest
basically it's broken because flags aren't being passed to wkwebview
no idea if anyone is working on a fix, I didn't see a PR but it is totally blocking me from moving forward on my project and I'm not confident enough in Rust/Tuari internals to really help
these flags are for linux
I figured they were webkit specific flags, but I guess that shoes my level of knowlege
though i'm confused what they tried that seemingly made it work when the webkitgtk guys themselves say it's not available yet and when it looks like the distro maintainers don't enable it at compile time 🤔
Nope, webkit_gtk_ specific :/ But even so, they are about webcam and microphone which already worked on macos for a somewhat long time.
Yeah I guess I need to read better 😬
Also i'm almost inclined to say that getDisplayMedia seemingly working in 13.5 was a bug because officially apple doesn't support it in wkwebview to my knowledge 🤔
I vaugely remember it being in a changelog as being added in 16.3 or something but I wouldn't stake my life on that