Этот коммит содержится в:
Anton Tananaev
2022-07-24 11:25:09 -07:00
родитель fb0c0cc3b0
Коммит 15d3d491a1
+11 -1
Просмотреть файл
@@ -64,7 +64,7 @@ class MainFragment : WebViewFragment() {
if ((activity.applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
WebView.setWebContentsDebuggingEnabled(true)
}
webView.webViewClient = WebViewClient() // handle redirects in the app
webView.webViewClient = webViewClient
webView.webChromeClient = webChromeClient
webView.addJavascriptInterface(AppInterface(), "appInterface")
val webSettings = webView.settings
@@ -134,6 +134,16 @@ class MainFragment : WebViewFragment() {
private var geolocationRequestOrigin: String? = null
private var geolocationCallback: GeolocationPermissions.Callback? = null
private val webViewClient = object : WebViewClient() {
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CookieManager.getInstance().flush()
}
}
}
private val webChromeClient = object : WebChromeClient() {
override fun onCreateWindow(view: WebView, isDialog: Boolean, isUserGesture: Boolean, resultMsg: Message): Boolean {