tauri: media permission denied [bug]
Describe the bug
Unable to call camera,unauthorized. No related items found in devtools.
Reproduction
No response
Expected behavior
No response
Platform and versions
window10 x64
pnpm 7
nodejs 16
tauri 1.0.0
Stack trace
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (7 by maintainers)
I also have OCD, it took me several days to find it
tauri version v2 dependencies: webview2-com = “0.31.0” windows = “0.57.0”
Hello, we recently added the new experimental Permission Management APIs. Can you check if this meets your needs? https://github.com/MicrosoftEdge/WebView2Feedback/issues/2427#issuecomment-1399097515 Thanks!
Weichens code is just a normal command https://v2.tauri.app/develop/calling-rust/#commands (the code they showed is windows only btw), so it probably belongs in your src-tauri/src/lib.rs file.
if you’re using v2, yes (in v1 the webview bindings are too old). Then you can use the mentioned SetPermissionState in with_webview (via the bindings). If all this is new to you, it would look something like this, just to get a feel for it.
@Interpause You can handle that for your users in rust too. And i know that’s not what you were aiming at, the problem here is that actual solutions are blocked by https://github.com/MicrosoftEdge/WebView2Feedback/issues/2427 😕
Edit: Since this issue was just linked to from a really extensive issue a short additional note: In case someone wonders why we don’t work around the missing permissions api by hooking into the PermissionRequested event (which by itself would be kinda annoying imo), the reason is: it doesn’t work, see https://github.com/MicrosoftEdge/WebView2Feedback/issues/2672
I don’t think that is a proper solution, it certainly isn’t user-friendly to request the user to do the above to reset permission state.
users can delete
C:\Users\<user-name>\AppData\Local\<your-app-bundle-identifieer>\EBWebViewdirectory and it will reset the permissions state, so you can prompt them for it again.