Bootstrap

Android. webview基本配置以及SSLerror错误过滤

@SuppressLint("SetJavaScriptEnabled")
    fun setWebSettings(context: Context?, mWebView: WebView) {
        val webSettings = mWebView.settings
        //        webSettings.setTextSize(WebSettings.TextSize.NORMAL);
        // 设置支持JavaScript
        webSettings.javaScriptEnabled = true
        webSettings.loadWithOverviewMode = true
        webSettings.defaultTextEncodingName = "utf-8"
        webSettings.layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN
        webSettings.useWideViewPort = true
        //        webSettings.setSupportZoom(true);
        webSettings.domStorageEnabled = true //打开DOM存储
        webSettings.javaScriptCanOpenWindowsAutomatically = true
        webSettings.pluginState = WebSettings.PluginState.ON
        webSettings.allowFileAccess = true
        webSettings.builtInZoomControls = true
        webSettings.setSupportZoom(false) // 设置不能支持缩放
        webSettings.setAppCacheEnabled(tr
;