Merge remote-tracking branch 'origin/main'

This commit is contained in:
Hosted Weblate 2026-05-14 08:56:45 +02:00
commit 3c2015fe58
No known key found for this signature in database
GPG key ID: A3FAAA06E6569B4C
2 changed files with 7 additions and 3 deletions

View file

@ -121,8 +121,10 @@ class MainActivity : AppCompatActivity() {
} }
} }
} }
if (BuildConfig.DEBUG) {
WebView.setWebContentsDebuggingEnabled(true) WebView.setWebContentsDebuggingEnabled(true)
} }
}
override fun onNewIntent(intent: Intent) { override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent) super.onNewIntent(intent)

View file

@ -29,6 +29,7 @@ import android.webkit.JavascriptInterface
import android.webkit.WebChromeClient import android.webkit.WebChromeClient
import android.webkit.WebView import android.webkit.WebView
import android.webkit.WebViewClient import android.webkit.WebViewClient
import com.aryan.reader.BuildConfig
import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.withTimeoutOrNull import kotlinx.coroutines.withTimeoutOrNull
@ -75,12 +76,13 @@ class MathMLRenderer(private val context: Context) {
private fun setupWebView() { private fun setupWebView() {
try { try {
if (BuildConfig.DEBUG) {
WebView.setWebContentsDebuggingEnabled(true) WebView.setWebContentsDebuggingEnabled(true)
}
webView = WebView(context).apply { webView = WebView(context).apply {
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
settings.javaScriptEnabled = true settings.javaScriptEnabled = true
settings.allowFileAccess = true
settings.domStorageEnabled = true settings.domStorageEnabled = true
addJavascriptInterface(WebAppInterface { svg -> addJavascriptInterface(WebAppInterface { svg ->
completeCurrentJob(RenderResult.Success(svg)) completeCurrentJob(RenderResult.Success(svg))