feat(sdk-webview): add debugEnabled flag for Chrome DevTools H5 debugging
Set debugEnabled = true in XWebViewConfig to enable WebView remote debugging via chrome://inspect. Calls WebView.setWebContentsDebuggingEnabled() before WebView instantiation in both XWebViewView and XWebViewActivity. Bump to 1.0.8. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
6da62dc600
当前提交
e958b2a42c
@ -7,5 +7,5 @@ SDK_CORE_VERSION=1.0.6
|
|||||||
SDK_IM_VERSION=1.0.5
|
SDK_IM_VERSION=1.0.5
|
||||||
SDK_PUSH_VERSION=1.0.5
|
SDK_PUSH_VERSION=1.0.5
|
||||||
SDK_UPDATE_VERSION=1.0.6
|
SDK_UPDATE_VERSION=1.0.6
|
||||||
SDK_WEBVIEW_VERSION=1.0.7
|
SDK_WEBVIEW_VERSION=1.0.8
|
||||||
SDK_LICENSE_VERSION=1.0.6
|
SDK_LICENSE_VERSION=1.0.6
|
||||||
|
|||||||
@ -90,6 +90,7 @@ class XWebViewActivity : ComponentActivity() {
|
|||||||
|
|
||||||
val config = getXWebViewConfig()
|
val config = getXWebViewConfig()
|
||||||
|
|
||||||
|
WebView.setWebContentsDebuggingEnabled(config.debugEnabled)
|
||||||
val container = FrameLayout(this)
|
val container = FrameLayout(this)
|
||||||
webView = WebView(this).apply {
|
webView = WebView(this).apply {
|
||||||
settings.javaScriptEnabled = true
|
settings.javaScriptEnabled = true
|
||||||
|
|||||||
@ -8,6 +8,7 @@ data class XWebViewConfig(
|
|||||||
val userAgent: String? = null,
|
val userAgent: String? = null,
|
||||||
val injectedJavaScript: String? = null,
|
val injectedJavaScript: String? = null,
|
||||||
val jsBridgeName: String = "XWebViewBridge",
|
val jsBridgeName: String = "XWebViewBridge",
|
||||||
|
val debugEnabled: Boolean = false,
|
||||||
val onMessage: ((String) -> Unit)? = null,
|
val onMessage: ((String) -> Unit)? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -220,6 +220,7 @@ fun XWebViewView(
|
|||||||
AndroidView(
|
AndroidView(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
factory = { ctx ->
|
factory = { ctx ->
|
||||||
|
WebView.setWebContentsDebuggingEnabled(config.debugEnabled)
|
||||||
val wv = WebView(ctx).apply {
|
val wv = WebView(ctx).apply {
|
||||||
settings.javaScriptEnabled = true
|
settings.javaScriptEnabled = true
|
||||||
settings.domStorageEnabled = true
|
settings.domStorageEnabled = true
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户