Skip to content

Commit

Permalink
feat(webview): enable web contents debugging and simplify settings
Browse files Browse the repository at this point in the history
  • Loading branch information
syxc committed Aug 25, 2024
1 parent 6e1a409 commit bff4ef4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/com/ding1ding/jsbridge/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class MainActivity :
@SuppressLint("SetJavaScriptEnabled")
private fun setupWebView() {
webView = findViewById<WebView>(R.id.webView).apply {
// WebView.setWebContentsDebuggingEnabled(true)
settings.javaScriptEnabled = true
settings.allowUniversalAccessFromFileURLs = true
WebView.setWebContentsDebuggingEnabled(true)
settings.apply {
javaScriptEnabled = true
allowUniversalAccessFromFileURLs = true
}
webViewClient = createWebViewClient()
loadUrl("file:///android_asset/index.html")
}
Expand Down

0 comments on commit bff4ef4

Please sign in to comment.