Interface CefriumRequestHandler


public interface CefriumRequestHandler
Request/navigation and render-process notifications from CEF's CefRequestHandler that are not already delivered by the SSL, HTTP-auth or request-interception paths. All methods are default, so implement only what you need. Register with CefriumBrowser.setRequestHandler(CefriumRequestHandler).

Delivered on the browser UI thread.

  • Method Details

    • onOpenUrlFromTab

      default void onOpenUrlFromTab(String targetUrl, int disposition, boolean userGesture)
      A link/JS requested opening a URL in a new tab (window.open, target=_blank, ctrl-click). The page's default popup path still runs.
      Parameters:
      targetUrl - The URL requested.
      disposition - Chromium cef_window_open_disposition_t.
      userGesture - Whether it originated from a user gesture.
    • onRenderUnresponsive

      default void onRenderUnresponsive()
      The render process became unresponsive (WebView onRenderProcessUnresponsive).
    • onRenderResponsive

      default void onRenderResponsive()
      A previously unresponsive render process became responsive again.
    • onRenderViewReady

      default void onRenderViewReady()
      The render view is ready.
    • onDocumentAvailable

      default void onDocumentAvailable()
      The document is available in the main frame (DOM ready).
    • onSelectClientCertificate

      default void onSelectClientCertificate(boolean isProxy, String host, int port, String[] subjectNames, CefriumRequestHandler.ClientCertificateCallback callback)
      The server requested a client certificate (mTLS). Pick one via callback, or cancel to proceed without one. Without a handler set, the default behaviour (no client certificate) is used.
      Parameters:
      isProxy - True if the request is from a proxy.
      host - The requesting host.
      port - The requesting port.
      subjectNames - Display names of the offered certificates, by index.
      callback - Selection callback.
    • onResourceRedirect

      default void onResourceRedirect(String oldUrl, String newUrl)
      A resource load was redirected.
    • onResourceResponse

      default void onResourceResponse(String url, int statusCode)
      A resource response was received (inspection only).
    • onResourceLoadComplete

      default void onResourceLoadComplete(String url, int statusCode, long receivedBytes)
      A resource finished loading.
    • onResponseData

      default void onResponseData(String url, ByteBuffer chunk)
      A chunk of a response body (opt-in; enable with CefriumBrowser.setResponseTapEnabled(boolean)). The data passes through unmodified; this is a read-only tap. chunk is a direct buffer valid only during this call — copy what you need. Delivered on an IO thread, once per chunk (a hot path; enable only when needed).
    • onCanSendCookie

      default boolean onCanSendCookie(String url, String name, String value)
      Whether a cookie may be SENT with a request (opt-in; enable with CefriumBrowser.setCookieFilterEnabled(boolean)). Return false to block it. Called per cookie on the network path (a hot path).
    • onCanSaveCookie

      default boolean onCanSaveCookie(String url, String name, String value)
      Whether a cookie may be SAVED from a response (opt-in; see CefriumBrowser.setCookieFilterEnabled(boolean)). Return false to block it.