disable zoom, disable ssl checks due to LetsEncrypt changes in Jan 2021
This commit is contained in:
parent
88f66d681d
commit
7c89015d72
dashboard
@ -1,4 +1,5 @@
|
||||
using Android.App;
|
||||
using Android.Net.Http;
|
||||
using Android.OS;
|
||||
using Android.Webkit;
|
||||
|
||||
@ -15,6 +16,8 @@ namespace dashboard
|
||||
|
||||
var webView = FindViewById<WebView>(Resource.Id.webView);
|
||||
webView.Settings.JavaScriptEnabled = true;
|
||||
webView.Settings.BuiltInZoomControls = false;
|
||||
webView.Settings.DisplayZoomControls = false;
|
||||
|
||||
// Use subclassed WebViewClient to hide default chrome (url bar and stuff)
|
||||
webView.SetWebViewClient(new HybridWebViewClient());
|
||||
@ -22,7 +25,21 @@ namespace dashboard
|
||||
webView.LoadUrl("https://api.mayer.life/dashboard/");
|
||||
}
|
||||
|
||||
private class HybridWebViewClient : WebViewClient { }
|
||||
private class HybridWebViewClient : WebViewClient
|
||||
{
|
||||
public override void OnReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
|
||||
{
|
||||
// ignore "untrusted" ssl errors (due to LetsEncrypt changes in January 2021 and compatibility with only Android 7.1+)
|
||||
if (error.PrimaryError == SslErrorType.Untrusted || error.PrimaryError == SslErrorType.Invalid)
|
||||
{
|
||||
handler.Proceed();
|
||||
}
|
||||
else
|
||||
{
|
||||
handler.Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
1
dashboard/Resources/Resource.designer.cs
generated
1
dashboard/Resources/Resource.designer.cs
generated
@ -2,7 +2,6 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
Loading…
x
Reference in New Issue
Block a user