public JBCefClient addContextMenuHandler(@NotNull CefContextMenuHandler handler, @NotNull CefBrowser browser) {
    return myContextMenuHandler.add(handler, browser, () -> {
      myCefClient.addContextMenuHandler(new CefContextMenuHandler() {
        @Override
        public void onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model) {
          myContextMenuHandler.handleAll(browser, handler -> {
            handler.onBeforeContextMenu(browser, frame, params, model);
          });
        }

        @Override
        public boolean onContextMenuCommand(CefBrowser browser,
                                            CefFrame frame,
                                            CefContextMenuParams params,
                                            int commandId,
                                            int eventFlags) {
          return myContextMenuHandler.handleBooleanReturnAnyOf(browser, handler -> {
            return handler.onContextMenuCommand(browser, frame, params, commandId, eventFlags);
          });
        }

        @Override
        public void onContextMenuDismissed(CefBrowser browser, CefFrame frame) {
          myContextMenuHandler.handleAll(browser, handler -> {
            handler.onContextMenuDismissed(browser, frame);
          });
        }
      });
    });
  }
public JBCefClient addContextMenuHandler(@NotNull CefContextMenuHandler handler, @NotNull CefBrowser browser)