Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2cab2691ea
2 changed files with 7 additions and 3 deletions
|
|
@ -121,8 +121,10 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (BuildConfig.DEBUG) {
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import android.webkit.JavascriptInterface
|
|||
import android.webkit.WebChromeClient
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import com.aryan.reader.BuildConfig
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
|
|
@ -75,12 +76,13 @@ class MathMLRenderer(private val context: Context) {
|
|||
|
||||
private fun setupWebView() {
|
||||
try {
|
||||
if (BuildConfig.DEBUG) {
|
||||
WebView.setWebContentsDebuggingEnabled(true)
|
||||
}
|
||||
|
||||
webView = WebView(context).apply {
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
settings.javaScriptEnabled = true
|
||||
settings.allowFileAccess = true
|
||||
settings.domStorageEnabled = true
|
||||
addJavascriptInterface(WebAppInterface { svg ->
|
||||
completeCurrentJob(RenderResult.Success(svg))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue