JBCefClient (@NotNull CefLoadHandler handler, @NotNull CefBrowser browser) { return myLoadHandler.add(handler, browser, () -> { myCefClient.addLoadHandler(new CefLoadHandler() { @Override public void onLoadingStateChange(CefBrowser browser, boolean isLoading, boolean canGoBack, boolean canGoForward) { myLoadHandler.handle(browser, handler -> { handler.onLoadingStateChange(browser, isLoading, canGoBack, canGoForward); }); } @Override public void onLoadStart(CefBrowser browser, CefFrame frame, CefRequest.TransitionType transitionType) { myLoadHandler.handle(browser, handler -> { handler.onLoadStart(browser, frame, transitionType); }); } @Override public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) { myLoadHandler.handle(browser, handler -> { handler.onLoadEnd(browser, frame, httpStatusCode); }); } @Override public void onLoadError(CefBrowser browser, CefFrame frame, ErrorCode errorCode, String errorText, String failedUrl) { myLoadHandler.handle(browser, handler -> { handler.onLoadError(browser, frame, errorCode, errorText, failedUrl); }); } }); }); }