Skip to content

Commit

Permalink
Merge pull request #7920 from hansemannn/TIMOB-18066
Browse files Browse the repository at this point in the history
[TIMOB-18066] Android: Support remote debugging / inspecting of Android webviews
  • Loading branch information
hieupham007 committed Apr 7, 2016
2 parents 04ba20a + 3723a26 commit 23c9e3f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import ti.modules.titanium.ui.android.AndroidModule;
import android.content.Context;
import android.content.pm.FeatureInfo;
import android.content.pm.ApplicationInfo;
import android.graphics.Color;
import android.graphics.Rect;
import android.net.Uri;
Expand Down Expand Up @@ -183,6 +184,14 @@ private boolean isHTCSenseDevice()
public TiUIWebView(TiViewProxy proxy)
{
super(proxy);

// We can only support debugging in API 19 and higher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// Only enable webview debugging, when app is debuggable
if (0 != (proxy.getActivity().getApplicationContext().getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)) {
WebView.setWebContentsDebuggingEnabled(true);
}
}

TiWebView webView = isHTCSenseDevice() ? new TiWebView(proxy.getActivity()) : new NonHTCWebView(proxy.getActivity());
webView.setVerticalScrollbarOverlay(true);
Expand Down

0 comments on commit 23c9e3f

Please sign in to comment.