Skip to content
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

Closed
codeaphex opened this issue Sep 3, 2022 · 3 comments
Closed
Labels

Comments

@codeaphex
Copy link

codeaphex commented Sep 3, 2022

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:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="WebView_Repro.MainPage">

    <WebView Source="https://www.n-tv.de/mediathek/videos/politik/Gorbatschow-Beisetzung-ist-kein-grosses-Ereignis-article23564944.html" />

</ContentPage>

Steps to Reproduce

  1. Create webview
  2. Navigate to any page on https://www.n-tv.de
  3. Try to scroll

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

@codeaphex codeaphex added the t/bug Something isn't working label Sep 3, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 5, 2022
@jsuarezruiz jsuarezruiz added platform/android 🤖 and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Sep 5, 2022
@jfversluis jfversluis added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 5, 2022
@mattleibow
Copy link
Member

I tested with Android Studio and the cookies popup appears - but not in MAUI.

@mattleibow
Copy link
Member

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

@mattleibow mattleibow added this to the .NET 6 + Servicing milestone Sep 5, 2022
@codeaphex
Copy link
Author

Wow, thx for the quick workaround and PR.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 7, 2022
@samhouts samhouts added the fixed-in-6.0.540 Look for this fix in 6.0.540 SR5! label Feb 17, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants