Condividi tramite


WebView.SetWebContentsDebuggingEnabled(Boolean) Method

Definition

Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application.

[Android.Runtime.Register("setWebContentsDebuggingEnabled", "(Z)V", "")]
public static void SetWebContentsDebuggingEnabled (bool enabled);
[<Android.Runtime.Register("setWebContentsDebuggingEnabled", "(Z)V", "")>]
static member SetWebContentsDebuggingEnabled : bool -> unit

Parameters

enabled
Boolean

whether to enable web contents debugging

Attributes

Remarks

Enables debugging of web contents (HTML / CSS / JavaScript) loaded into any WebViews of this application. This flag can be enabled in order to facilitate debugging of web layouts and JavaScript code running inside WebViews. Please refer to WebView documentation for the debugging guide.

In WebView 113.0.5656.0 and later, this is enabled automatically if the app is declared as android:debuggable="true"https://developer.android.com/guide/topics/manifest/application-element#debug in its manifest; otherwise, the default is false.

Enabling web contents debugging allows the state of any WebView in the app to be inspected and modified by the user via adb. This is a security liability and should not be enabled in production builds of apps unless this is an explicitly intended use of the app. More info on secure debug settings.

Java documentation for android.webkit.WebView.setWebContentsDebuggingEnabled(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to