There is currently no way to modify an Android WebView's mixed content mode setting without creating a custom renderer.
Add a PlatformSpecific property for WebView on Android to set the value of WebSettings.MixedContentMode.
enum MixedContentHandling
{
AlwaysAllow = 0,
NeverAllow = 1,
CompatibilityMode = 2
}
public static readonly BindableProperty MixedContentModeProperty = BindableProperty.Create("MixedContentMode", typeof(MixedContentHandling), typeof(WebView), MixedContentHandling.NeverAllow);
Below API 21 this value should be ignored. At API 21 or above, this value should be applied to MixedContentMode.
There is currently no applicable setting for iOS (allowing mixed content requires modifying application-level plist values) or UWP (the UWP WebView just lets any old thing load up).
At API 21 and above, this value defaults to NeverAllow; below API 21, it is ignored. So as long as the default value of the PlatformSpecific is NeverAllow, this should be backward compatible.
I can take this!
@davidortinau I've claimed this a few days ago but it hasn't been moved to in progress, just an FYI
@alanag13 Have at it.
@hartez @davidortinau @adamped i have a PR for this ready here: https://github.com/XamarinFormsCommunity/Xamarin.Forms/pull/3. Thanks!
Most helpful comment
@hartez @davidortinau @adamped i have a PR for this ready here: https://github.com/XamarinFormsCommunity/Xamarin.Forms/pull/3. Thanks!