Skip to content

Commit

Permalink
Merge pull request #128 from wangdaliu/fix-freeze-issue
Browse files Browse the repository at this point in the history
Disallow canceling dialog in onJsConfirm
  • Loading branch information
robokitten007 authored Mar 18, 2024
2 parents 878daaf + 79d71f5 commit c50d5fa
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public boolean onConsoleMessage(ConsoleMessage cm) {
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
new AlertDialog.Builder(view.getContext()).setTitle(R.string.affirm)
.setMessage(message)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, (dialog, which) -> result.confirm())
.setNegativeButton(android.R.string.cancel, (dialog, which) -> result.cancel())
.create()
Expand Down

0 comments on commit c50d5fa

Please sign in to comment.