public static interface GeckoSession.NavigationDelegate
Modifier and Type | Interface and Description |
---|---|
static class |
GeckoSession.NavigationDelegate.LoadRequest
Load request details.
|
Modifier and Type | Field and Description |
---|---|
static int |
LOAD_REQUEST_IS_REDIRECT
The load request was triggered by an HTTP redirect.
|
static int |
TARGET_WINDOW_CURRENT |
static int |
TARGET_WINDOW_NEW |
static int |
TARGET_WINDOW_NONE |
Modifier and Type | Method and Description |
---|---|
default void |
onCanGoBack(GeckoSession session,
boolean canGoBack)
The view's ability to go back has changed.
|
default void |
onCanGoForward(GeckoSession session,
boolean canGoForward)
The view's ability to go forward has changed.
|
default GeckoResult<String> |
onLoadError(GeckoSession session,
String uri,
WebRequestError error) |
default GeckoResult<AllowOrDeny> |
onLoadRequest(GeckoSession session,
GeckoSession.NavigationDelegate.LoadRequest request)
A request to open an URI.
|
default void |
onLocationChange(GeckoSession session,
String url)
A view has started loading content from the network.
|
default void |
onLocationChange(GeckoSession session,
String url,
List<GeckoSession.PermissionDelegate.ContentPermission> perms)
A view has started loading content from the network.
|
default GeckoResult<GeckoSession> |
onNewSession(GeckoSession session,
String uri)
A request has been made to open a new session.
|
default GeckoResult<AllowOrDeny> |
onSubframeLoadRequest(GeckoSession session,
GeckoSession.NavigationDelegate.LoadRequest request)
A request to load a URI in a non-top-level context.
|
static final int TARGET_WINDOW_NONE
static final int TARGET_WINDOW_CURRENT
static final int TARGET_WINDOW_NEW
static final int LOAD_REQUEST_IS_REDIRECT
@UiThread @DeprecationSchedule(id="location-permissions", version=92) default void onLocationChange(@NonNull GeckoSession session, @Nullable String url)
session
- The GeckoSession that initiated the callback.url
- The resource being loaded.@UiThread default void onLocationChange(@NonNull GeckoSession session, @Nullable String url, @NonNull List<GeckoSession.PermissionDelegate.ContentPermission> perms)
session
- The GeckoSession that initiated the callback.url
- The resource being loaded.perms
- The permissions currently associated with this url.@UiThread default void onCanGoBack(@NonNull GeckoSession session, boolean canGoBack)
session
- The GeckoSession that initiated the callback.canGoBack
- The new value for the ability.@UiThread default void onCanGoForward(@NonNull GeckoSession session, boolean canGoForward)
session
- The GeckoSession that initiated the callback.canGoForward
- The new value for the ability.@UiThread @Nullable default GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession session, @NonNull GeckoSession.NavigationDelegate.LoadRequest request)
session
- The GeckoSession that initiated the callback.request
- The GeckoSession.NavigationDelegate.LoadRequest
containing the request details.GeckoResult
with a AllowOrDeny
value which indicates whether
or not the load was handled. If unhandled, Gecko will continue the
load as normal. If handled (a DENY
value), Gecko
will abandon the load. A null return value is interpreted as
ALLOW
(unhandled).@UiThread @Nullable default GeckoResult<AllowOrDeny> onSubframeLoadRequest(@NonNull GeckoSession session, @NonNull GeckoSession.NavigationDelegate.LoadRequest request)
session
- The GeckoSession that initiated the callback.request
- The GeckoSession.NavigationDelegate.LoadRequest
containing the request details.GeckoResult
with a AllowOrDeny
value which indicates whether
or not the load was handled. If unhandled, Gecko will continue the
load as normal. If handled (a DENY
value), Gecko
will abandon the load. A null return value is interpreted as
ALLOW
(unhandled).@UiThread @Nullable default GeckoResult<GeckoSession> onNewSession(@NonNull GeckoSession session, @NonNull String uri)
session
- The GeckoSession that initiated the callback.uri
- The URI to be loaded.GeckoResult
which holds the returned GeckoSession. May be null, in
which case the request for a new window by web content will fail. e.g.,
window.open()
will return null.
The implementation of onNewSession is responsible for maintaining a reference
to the returned object, to prevent it from being garbage collected.@UiThread @Nullable default GeckoResult<String> onLoadError(@NonNull GeckoSession session, @Nullable String uri, @NonNull WebRequestError error)
session
- The GeckoSession that initiated the callback.uri
- The URI that failed to load.error
- A WebRequestError containing details about the error