public void addHandler(@NotNull Function<? super String, ? extends Response> handler) {
    checkDisposed();

    CefMessageRouterHandler cefHandler;
    myFunc.myRouter.addHandler(cefHandler = new CefMessageRouterHandlerAdapter() {
      @Override
      public boolean onQuery(CefBrowser browser,
                             CefFrame frame,
                             long query_id,
                             String request,
                             boolean persistent,
                             CefQueryCallback callback)
      {
        if (DEBUG_JS)
          CefLog.Debug("onQuery: browser=%s, frame=%s, qid=%d, request=%s", browser, frame, query_id, request);
        Response response = handler.apply(request);
        if (callback != null && response != null) {
          if (response.isSuccess() && response.hasResponse()) {
            callback.success(response.response());
          } else {
            callback.failure(response.errCode(), response.errMsg());
          }
        } else if (callback != null) {
          callback.success("");
        }
        return true;
      }

      @Override
      public void onQueryCanceled(CefBrowser browser, CefFrame frame, long queryId) {
        if (DEBUG_JS)
          CefLog.Debug("onQueryCanceled: browser=%s, frame=%s, qid=%d", browser, frame, queryId);
      }
    }, false);
    myHandlerMap.put(handler, cefHandler);
  }
public void addHandler(@NotNull Function<? super String, ? extends Response> handler)