#is getDisplayMedia still unavailable in WKWebView?

1 messages · Page 1 of 1 (latest)

slate wagon
#

I'm trying to use getDisplayMedia and hitting the permissions issues. Finding conflicting information as to what the status is here. Some say that it was added in a modern version of MacOS, but that doesn't seem to be my experience. What's the latest here?

slate wagon
#

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

signal hamlet
#

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.

slate wagon
#

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

signal hamlet
#

It's a Tauri DX problem with a work-around of implementing the permissions handling yourself using with_webview.

slate wagon
#

Gotcha. Are there any examples of anyone doing this kind of thing? Not even for getDisplayMedia but any permissions?

signal hamlet
#

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.

slate wagon
#

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

signal hamlet
#

That would be great. If you'd like, you can share the blog post in #1047149172144492604 and add it to the Awesome Tauri repository.

slate wagon
#

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

signal hamlet
#

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.

slate wagon
#

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 😦

slate wagon
#

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

drifting comet
#

do you find anything else to this issue @slate wagon ?

slate wagon
#

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

raven solstice
slate wagon
#

I figured they were webkit specific flags, but I guess that shoes my level of knowlege

raven solstice
# raven solstice these flags are for linux

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 🤔

raven solstice
slate wagon
#

Yeah I guess I need to read better 😬

raven solstice
#

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 🤔

slate wagon
#

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