Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/MainActivity.java

Issue 29555716: Issue 5770 - Allow WebView debugging (Closed)
Patch Set: Created Sept. 25, 2017, 12:17 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/MainActivity.java
===================================================================
--- a/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/MainActivity.java
+++ b/libadblockplus-android-webviewapp/src/org/adblockplus/libadblockplus/android/webviewapp/MainActivity.java
@@ -55,16 +55,23 @@
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bindControls();
initControls();
+
+ // allow WebView debugging in "Debug" build variant
+ // https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews
+ if (BuildConfig.DEBUG)
+ {
+ WebView.setWebContentsDebuggingEnabled(true);
+ }
}
private void bindControls()
{
url = (EditText) findViewById(R.id.main_url);
ok = (Button) findViewById(R.id.main_ok);
back = (Button) findViewById(R.id.main_back);
forward = (Button) findViewById(R.id.main_forward);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld