Skip to content

Commit

Permalink
Fix ERR_ABORTED when opening links (#416)
Browse files Browse the repository at this point in the history
Ignore ERR_ABORTED errors caused because JBCef cancels redirections when opening in an external browser.
  • Loading branch information
asafgabai authored Sep 13, 2023
1 parent 318d728 commit 48781ce
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) {
@Override
public void onLoadError(CefBrowser browser, CefFrame frame, ErrorCode errorCode, String errorText, String failedUrl) {
super.onLoadError(browser, frame, errorCode, errorText, failedUrl);
// When opening links in external browser, JBCef cancels the page redirection and opens the page in a new browser window.
// This cancelation causes CEF to throw an ERR_ABORTED error.
if (errorCode == ErrorCode.ERR_ABORTED) {
return;
}
Logger.getInstance().error("An error occurred while opening the issue details view: " + errorText);
}
}, jbCefBrowser.getCefBrowser());
Expand Down

0 comments on commit 48781ce

Please sign in to comment.