File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
app/src/main/java/org/b3log/siyuan Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ public String getBlockURL() {
5959 return blockURL ;
6060 }
6161
62+ @ JavascriptInterface
63+ public void setWebViewDebuggingEnabled (final boolean debuggable ) {
64+ activity .setWebViewDebuggable (debuggable );
65+ }
66+
6267 @ JavascriptInterface
6368 public String readClipboard () {
6469 final ClipboardManager clipboard = (ClipboardManager ) activity .getSystemService (Context .CLIPBOARD_SERVICE );
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ protected void onCreate(final Bundle savedInstanceState) {
140140
141141 // 使用 Chromium 调试 WebView
142142 if (Utils .isDebugPackageAndMode (this )) {
143- WebView . setWebContentsDebuggingEnabled (true );
143+ this . setWebViewDebuggable (true );
144144 }
145145
146146 // 注册工具栏显示/隐藏跟随软键盘状态
@@ -709,6 +709,10 @@ private void checkWebViewVer(final WebSettings ws) {
709709 }
710710 }
711711
712+ public void setWebViewDebuggable (final boolean debuggable ) {
713+ WebView .setWebContentsDebuggingEnabled (debuggable );
714+ }
715+
712716 private static boolean syncing ;
713717
714718 public static void startSyncData () {
You can’t perform that action at this time.
0 commit comments