Extract user agent string from WebView

This commit is contained in:
arkon
2021-01-23 15:57:59 -05:00
parent 04a993c997
commit 0685382083
4 changed files with 35 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.system.WebViewUtil
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
@@ -74,7 +75,7 @@ abstract class HttpSource : CatalogueSource {
* Headers builder for requests. Implementations can override this method for custom headers.
*/
protected open fun headersBuilder() = Headers.Builder().apply {
add("User-Agent", DEFAULT_USERAGENT)
add("User-Agent", WebViewUtil.DEFAULT_USER_AGENT)
}
/**
@@ -369,8 +370,4 @@ abstract class HttpSource : CatalogueSource {
* Returns the list of filters for the source.
*/
override fun getFilterList() = FilterList()
companion object {
const val DEFAULT_USERAGENT = "Mozilla/5.0 (Windows NT 6.3; WOW64)"
}
}