Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jan 7, 2025
2 parents 757f663 + 15fc5c7 commit cb3a559
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/src/main/java/org/b3log/siyuan/JSAndroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public String getBlockURL() {
return blockURL;
}

@JavascriptInterface
public void setWebViewDebuggingEnabled(final boolean debuggable) {
activity.setWebViewDebuggable(debuggable);
}

@JavascriptInterface
public String readClipboard() {
final ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/org/b3log/siyuan/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected void onCreate(final Bundle savedInstanceState) {

// 使用 Chromium 调试 WebView
if (Utils.isDebugPackageAndMode(this)) {
WebView.setWebContentsDebuggingEnabled(true);
this.setWebViewDebuggable(true);
}

// 注册工具栏显示/隐藏跟随软键盘状态
Expand Down Expand Up @@ -709,6 +709,10 @@ private void checkWebViewVer(final WebSettings ws) {
}
}

public void setWebViewDebuggable(final boolean debuggable) {
WebView.setWebContentsDebuggingEnabled(debuggable);
}

private static boolean syncing;

public static void startSyncData() {
Expand Down

0 comments on commit cb3a559

Please sign in to comment.