-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific website not scrollable in WebView, probably cookie popup issue #9890
Comments
I tested with Android Studio and the cookies popup appears - but not in MAUI. |
This appears to be the underlying layout parameters passed to the WebView. Right now it is set to automatically grow to the size of the content regardless of the container. This results in the page breaking. A workaround for now is to catch the native view when it is loaded and set the layout parameters for Android: <WebView Source="https://www.youtube.com/watch?v=LXZfrnBasNU" Loaded="WebView_Loaded" /> private void WebView_Loaded(object sender, EventArgs e)
{
#if ANDROID
var view = sender as WebView;
var handler = view.Handler;
var webview = handler?.PlatformView as Android.Webkit.WebView;
if (webview is not null)
{
webview.LayoutParameters = new(
Android.Views.ViewGroup.LayoutParams.MatchParent,
Android.Views.ViewGroup.LayoutParams.MatchParent);
}
#endif |
Wow, thx for the quick workaround and PR. |
Description
Hi, I have a problem with a specific website which isnt scrollable inside the webview on Android.
If I open the same site inside chrome I get an cookie popup where I decline all optional ones and then be able to interact with the website. Also works flawless in MAUI Desktop.
Website (example, problem exists on whole domain):
https://www.n-tv.de/mediathek/videos/politik/Gorbatschow-Beisetzung-ist-kein-grosses-Ereignis-article23564944.html
Is there anything I can do to workaround this issue?
Repro even if its just:
Steps to Reproduce
Link to public reproduction project repository
https://github.com/codeaphex/WebView_Repro
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 11+
Did you find any workaround?
No.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: