'Why can I debug React Native Android WebView even though I haven't added WebView.setWebContentsDebuggingEnabled(true);?

I have a React Native application and a WebView for which I needed debugging, hence why I looked up how to add WebView debugging and found this - https://github.com/react-native-webview/react-native-webview/blob/master/docs/Debugging.md .

The weird part is that if I visit chrome://inspect/#devices I can see my virtual android device and I can inspect it even though I HAVE NOT added the following code to my project:

WebView.setWebContentsDebuggingEnabled(true);

This confused me because I want to be able to debug the WebView only on certain environments but even if I add a condition around WebView.setWebContentsDebuggingEnabled(true); I still see the inspect button.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source