瀏覽代碼

Update WebViewActivity.kt (#3617)

This code added is for some extension that blocks tachiyomi, by tricking it that it was sent by a android browser, nothing major changes,
armangido 4 年之前
父節點
當前提交
3f1355c413
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt

+ 3 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt

@@ -100,7 +100,9 @@ class WebViewActivity : BaseActivity<WebviewActivityBinding>() {
 
             binding.webview.webViewClient = object : WebViewClientCompat() {
                 override fun shouldOverrideUrlCompat(view: WebView, url: String): Boolean {
-                    view.loadUrl(url)
+                    val android_browser: MutableMap<String, String> = HashMap()
+                    android_browser["X-Requested-With"] = "com.android.browser"
+                    view.loadUrl(url,android_browser)
                     return true
                 }