TMA: repeated camera/microphone permission dialog on every WebView PermissionRequest in the same session#1947
Open
T-Damer wants to merge 1 commit intoDrKLO:masterfrom
Open
TMA: repeated camera/microphone permission dialog on every WebView PermissionRequest in the same session#1947T-Damer wants to merge 1 commit intoDrKLO:masterfrom
T-Damer wants to merge 1 commit intoDrKLO:masterfrom
Conversation
…very WebView PermissionRequest in the same session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Telegram Mini Apps on Android, camera/microphone access inside the WebView may trigger the Telegram permission dialog repeatedly within the same Mini App session.
This is especially visible when a Mini App uses
getUserMedia()more than once, for example:facingModeExpected behavior
If the user has already approved camera/microphone access for the current Mini App WebView session, and Android runtime permissions are still granted, repeated
PermissionRequests should be granted without showing the Telegram permission dialog again.Actual behavior
Telegram shows the WebView permission dialog again for subsequent
PermissionRequests, even when:CAMERA/RECORD_AUDIOpermissions are already grantedThis makes camera UX unstable for Mini Apps and may interrupt flows like video recording or camera switching.
Scope
This is about Telegram Mini Apps / WebView, not the native attach menu camera flow.
Reproduction
Notes
The issue appears to be in WebView
onPermissionRequest(...)handling in the Android client. Issue is not present on iOS clientA safe fix is to auto-grant repeated WebView media requests only inside the same Mini App session, when:
This should not bypass permission prompts for a fresh page load or a new Mini App session.