wry icon indicating copy to clipboard operation
wry copied to clipboard

Support for web APIs that require permissions

Open nklayman opened this issue 3 years ago • 15 comments

Is your feature request related to a problem? Please describe. Currently (at least on Linux), doing any action that requires permission (such as geolocation) fails as the permission request is immediately denied.

Describe the solution you'd like There should be a way to specify what permissions the app should have so they are automatically allowed.

Would you assign yourself to implement this feature?

  • [x] Yes (at least for Linux and maybe windows)
  • [ ] No

Additional context For linux: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-permission-request

nklayman avatar Feb 25 '21 20:02 nklayman

We also already enable some permissions required featured like clipboard on Windows already. https://github.com/tauri-apps/wry/blob/dev/src/webview/win32/mod.rs#L154

I couldn't find similar option on mac. And it seems lots of permission related features are not available to WkWebView. Edit: looks like this is an on-going feature to be implemented. Future custom protocol will be treated as secure content. https://bugs.webkit.org/show_bug.cgi?id=220184

wusyong avatar Apr 20 '21 05:04 wusyong

I think we did as good as we can do here, especially now that webrtc is working on macos, i think we are good.

nothingismagick avatar Apr 21 '21 09:04 nothingismagick

We should try with the localhost fix as it use same engine as macOS webview

lemarier avatar Apr 21 '21 09:04 lemarier

Reopen it until the PR is delivered

wusyong avatar Apr 21 '21 12:04 wusyong

It appears that PR didn't quite solve the issue I was referring to. There still doesn't seem to be a way to allow prompting for web APIs such as geolocation. If you try to use it inside Tauri (on Linux at least) it just fails immediately. If you use epiphany which also uses webkit2gtk, it prompts for location permissions. I think we should offer a way to prompt for or automatically allow certain permissions.

nklayman avatar Apr 29 '21 00:04 nklayman

Hello,

I have a WebRTC app that I would like to make it work with tauri. Would love to see this issue going forward!

kantum avatar May 02 '22 17:05 kantum

What's the status of this? Need to use geolocation in a tauri app and noticing that it doesn't work.

kevinelliott avatar Jun 22 '22 23:06 kevinelliott

It seems this is responsible for navigator.mediaDevices.getDisplayMedia not working too. We are stuck on porting to tauri because of this...

cliqer avatar Jul 04 '22 18:07 cliqer

@cliqer getDisplayMedia is not supported in WKWebView at all right now. No promises (just an idea), but we probably could do something similar to electron and inject it in getUserMedia, but don't hold your horses :/

I wanted to sent this comment a few weeks/months ago but something went wrong, anyway here it is, but i can't find the source for this right now, gonna update this comment if i find it again.

FabianLars avatar Sep 16 '22 10:09 FabianLars

@FabianLars Indeed it is not :/ and unfortunately, this has stopped us from porting our application to tauri for the time being.

The alternative at the moment, like building webrtc and adding an egui for screen capturing display selection within the rust layer, is almost impossible for us.

Many thanks and please do something similar to electron. Waiting eagerly for the implementation.

cliqer avatar Sep 17 '22 23:09 cliqer

is there any update ? i need to use Geolocation

mhsfh avatar Dec 24 '22 16:12 mhsfh

I would also like to use the microphone. MacOS. Looking through my inspector with permissions api, it says the microphone permission is set to "prompt", implying that the web might be thinking the prompt dialogue is showing when it isn't. When I try to start the dictation anyway, the console puts the error: Speech recognition error - "not-allowed". It works fine on Safari after I accept the permission prompt, which is either hidden or doesn't exist in Tauri. I would really appreciate having some kind of solution to this because dictation is central to my application.

petermakeswebsites avatar Apr 23 '23 15:04 petermakeswebsites

I think we should split this into smaller issues. The problems each user face is not the same. And each platform will need some extra works too. I believe we will need Infoplist on macOS for example. If you are interested in specific feature, please consider open an issue and hopefully a working wry example. We'll try to look into further if someone has time.

wusyong avatar Apr 24 '23 13:04 wusyong

I think we should split this into smaller issues. The problems each user face is not the same. And each platform will need some extra works too. I believe we will need Infoplist on macOS for example. If you are interested in specific feature, please consider open an issue and hopefully a working wry example. We'll try to look into further if someone has time.

How about start with geolocation :)

kevinelliott avatar Jul 28 '23 07:07 kevinelliott

Any update on this ?

ajayghoshcmonk avatar Mar 30 '24 07:03 ajayghoshcmonk