Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
3c2015fe58
2 changed files with 7 additions and 3 deletions
|
|
@ -121,7 +121,9 @@ class MainActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WebView.setWebContentsDebuggingEnabled(true)
|
if (BuildConfig.DEBUG) {
|
||||||
|
WebView.setWebContentsDebuggingEnabled(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNewIntent(intent: Intent) {
|
override fun onNewIntent(intent: Intent) {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
WebView.setWebContentsDebuggingEnabled(true)
|
if (BuildConfig.DEBUG) {
|
||||||
|
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))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue