mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Merge pull request #3993 from nextcloud/debugWebView
Enable webview debug on debug builds; disabled on productive builds
This commit is contained in:
commit
bc11455e79
1 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,8 @@ package com.owncloud.android.ui.activity;
|
|||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.Window;
|
||||
|
@ -91,6 +93,15 @@ public class ExternalSiteWebView extends FileActivity {
|
|||
webview.setFocusableInTouchMode(true);
|
||||
webview.setClickable(true);
|
||||
|
||||
|
||||
// allow debugging (when building the debug version); see details in
|
||||
// https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
|
||||
(getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
|
||||
Log_OC.d(this, "Enable debug for webView");
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
// setup toolbar
|
||||
if (showToolbar) {
|
||||
setupToolbar();
|
||||
|
|
Loading…
Reference in a new issue