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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSupplies the chosen client certificate (or none) for an mTLS challenge. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanonCanSaveCookie(String url, String name, String value) Whether a cookie may be SAVED from a response (opt-in; seeCefriumBrowser.setCookieFilterEnabled(boolean)).default booleanonCanSendCookie(String url, String name, String value) Whether a cookie may be SENT with a request (opt-in; enable withCefriumBrowser.setCookieFilterEnabled(boolean)).default voidThe document is available in the main frame (DOM ready).default voidonOpenUrlFromTab(String targetUrl, int disposition, boolean userGesture) A link/JS requested opening a URL in a new tab (window.open, target=_blank, ctrl-click).default voidA previously unresponsive render process became responsive again.default voidThe render process became unresponsive (WebViewonRenderProcessUnresponsive).default voidThe render view is ready.default voidonResourceLoadComplete(String url, int statusCode, long receivedBytes) A resource finished loading.default voidonResourceRedirect(String oldUrl, String newUrl) A resource load was redirected.default voidonResourceResponse(String url, int statusCode) A resource response was received (inspection only).default voidonResponseData(String url, ByteBuffer chunk) A chunk of a response body (opt-in; enable withCefriumBrowser.setResponseTapEnabled(boolean)).default voidonSelectClientCertificate(boolean isProxy, String host, int port, String[] subjectNames, CefriumRequestHandler.ClientCertificateCallback callback) The server requested a client certificate (mTLS).
-
Method Details
-
onOpenUrlFromTab
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- Chromiumcef_window_open_disposition_t.userGesture- Whether it originated from a user gesture.
-
onRenderUnresponsive
default void onRenderUnresponsive()The render process became unresponsive (WebViewonRenderProcessUnresponsive). -
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 viacallback, 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
-
onResourceResponse
A resource response was received (inspection only). -
onResourceLoadComplete
A resource finished loading. -
onResponseData
A chunk of a response body (opt-in; enable withCefriumBrowser.setResponseTapEnabled(boolean)). The data passes through unmodified; this is a read-only tap.chunkis 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
Whether a cookie may be SENT with a request (opt-in; enable withCefriumBrowser.setCookieFilterEnabled(boolean)). Return false to block it. Called per cookie on the network path (a hot path). -
onCanSaveCookie
Whether a cookie may be SAVED from a response (opt-in; seeCefriumBrowser.setCookieFilterEnabled(boolean)). Return false to block it.
-