Android 9 API 28 ONLY WebView is showing a black p

2019-08-22 02:31发布

问题:

I have been trying to figure out why one of the pop-ups inside a webview is showing a black screen in some devices. please see attach The URL works as URI but not inside the webview.

note: it seems the url have javascript issues. not sure why android 9 block its content

[chromium] [INFO:CONSOLE(3)] "Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080", source: https://mylink.com/js/libs/jquery/jquery.min.js (3)

Edit: I use a render to being able to get current location

xaml :

 <local:GeoWebView x:Name="Webview" HorizontalOptions="FillAndExpand"  
    VerticalOptions="FillAndExpand" />

c#

Webview.Source = new UrlWebViewSource
            {
               Url=https://MyLink.com/thisismytesturl.htm
            };

Render Android :

public class GeoWebViewRenderer : WebViewRenderer
    {
        public GeoWebViewRenderer(Context context) : base(context)
        {
        }

          protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.WebView> e)
         {
            base.OnElementChanged(e);

            Control.Settings.JavaScriptEnabled = true;
            Control.Settings.DomStorageEnabled=true;
          Control.Settings.JavaScriptCanOpenWindowsAutomatically=true;
            Control.SetWebChromeClient(new MyWebClient());
        }
    }

    public class MyWebClient : WebChromeClient
    {
        public override void OnGeolocationPermissionsShowPrompt(string 
         origin, GeolocationPermissions.ICallback callback)
        {
            callback.Invoke(origin, true, false);
        }
    }

2.it suppose to show something similar to the image.