Class GeckoSession
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Contains information about a product's analysis status response.static @interface
static interface
static @interface
static @interface
static class
Represent the result of a find-in-page operation.static class
Thrown when failure occurs when printing from a website.static @interface
static interface
An interface for recording new history visits and fetching the visited status for links.static class
Main entry point for loading URIs into aGeckoSession
.static @interface
static interface
GeckoSession applications implement this interface to handle media events.static interface
static class
Represent the result of a save-pdf operation.static @interface
static interface
GeckoSession applications implement this interface to handle requests for permissions from content, such as geolocation and notifications.static interface
Used for printing page content.static @interface
static interface
static interface
GeckoSession applications implement this interface to handle prompts triggered by content in the GeckoSession, such as alerts, authentication dialogs, and select list pickers.static class
Contains information about a product recommendation.static @interface
static class
Contains information about the analysis of a product's reviews.static interface
GeckoSession applications implement this interface to handle content scroll events.static interface
static @interface
static @interface
static @interface
static class
Class representing a saved session state.static @interface
static interface
Interface that SessionTextInput uses for performing operations such as opening and closing the software keyboard.static @interface
static class
WebResponseInfo contains information about a single web response. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Dim the rest of the page when showing a find-in-page match.static final int
Draw outlines around matching links.static final int
Highlight all find-in-page matches.static final int
Go backwards when finding the next match.static final int
Go forward when finding the next match.static final int
Limit matches to links on the page.static final int
Perform case-sensitive match; default is to perform a case-insensitive match.static final int
Must match entire words; default is to allow matching partial words.static final int
Filter headers according to the CORS safelisted rules.static final int
Allows most headers.static final int
Popup blocking will be disabled for this loadstatic final int
Bypass the cache.static final int
Bypass the URI classifier (content blocking and Safe Browsing).static final int
This load should bypass the NavigationDelegate.onLoadRequest.static final int
Bypass the proxy, if one has been configured.static final int
The load is coming from an external app.static final int
Allows a top-level data: navigation to occur.static final int
Default load flag, no special considerations.static final int
This flag specifies that any existing history entry should be replaced.protected org.mozilla.geckoview.GeckoSession.Window
static final int
Value for Priority when it is default.static final int
Value for Priority when it is high. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAcquire the GeckoDisplay instance for providing the session with a drawing Surface.void
close()
Closes the session.Get whether this GeckoSession has form data.Prints the currently displayed page and provides dialog finished status or if an exception occured.void
Exits fullscreen modeGet the SessionAccessibility instance for this session.Provides an autofill structure similar toView.onProvideAutofillVirtualStructure(ViewStructure, int)
, but does not rely onViewStructure
to build the tree.void
getClientBounds
(RectF rect) Get the bounds of the client area in client coordinates.void
getClientToScreenMatrix
(Matrix matrix) Get a matrix for transforming from client coordinates to screen coordinates.void
getClientToSurfaceMatrix
(Matrix matrix) Get a matrix for transforming from client coordinates to surface coordinates.Get the CompositorController instance for this session.Get the content blocking callback handler.Get the content callback handler.static String
Get the default user agent for this GeckoView build.Gets the experiment delegate for this session.Get the SessionFinder instance for this session, to perform find-in-page operations.Get the Media callback handler.Get the media session delegate.Get the navigation callback handler.Get the OverscrollEdgeEffect instance for this session.void
getPageToScreenMatrix
(Matrix matrix) Get a matrix for transforming from page coordinates to screen coordinates.void
getPageToSurfaceMatrix
(Matrix matrix) Get a matrix for transforming from page coordinates to surface coordinates.Get the PanZoomController instance for this session.Get the SessionPdfFileSaver instance for this session, to save a pdf document.Get the current permission delegate for this GeckoSession.Gets the print delegate for this session.Get the progress callback handler.Get the current prompt delegate for this GeckoSession.Get the current selection action delegate for this GeckoSession.The session translation object coordinates receiving and sending session messages with the translations toolkit.void
getSurfaceBounds
(Rect rect) Get the bounds of the client area in surface coordinates.Get the SessionTextInput instance for this session.Get the translations delegate.Get the current user agent string for this GeckoSession.Get the web compatibility info when a site is reported as broken.Returns a WebExtensionController for this GeckoSession.void
goBack()
Go back in history and assumes the call was based on a user interaction.void
goBack
(boolean userInteraction) Go back in history.void
Go forward in history and assumes the call was based on a user interaction.void
goForward
(boolean userInteraction) Go forward in history.void
gotoHistoryIndex
(int index) Navigate to an index in browser history; the index of the currently viewed page can be retrieved from an up-to-date HistoryList by callingGeckoSession.HistoryDelegate.HistoryList.getCurrentIndex()
.Checks whether we have a rule for this session.boolean
isOpen()
Return whether this session is open.isPdfJs()
Check if the document being viewed is a pdf.void
load
(GeckoSession.Loader request) Load page using theGeckoSession.Loader
specified.void
Load the given URI.void
open
(GeckoRuntime runtime) Opens the session.Poll for the status of the current analysis of product's reviews for a given product URL.void
Prints the currently displayed page.void
Purge history for the session.void
releaseDisplay
(GeckoDisplay display) Release an acquired GeckoDisplay instance.void
reload()
Reload the current URI.void
reload
(int flags) Reload the current URI.reportBackInStock
(String url) Report that a product is back in stock.requestAnalysis
(String url) Request analysis of product's reviews for a given product URL.Request the status of the current analysis of product's reviews for a given product URL.Request the creation of an analysis of product's reviews for a given product URL.Request product recommendations given a specific product url.void
Restore a saved state to this GeckoSession; only data that is saved (history, scroll position, zoom, and form data) will be restored.Saves a PDF of the currently displayed page.Send a click event to the Ad Attribution API.Send an impression event to the Ad Attribution API.Send a placement event to the Ad Attribution API.void
setActive
(boolean active) Set this GeckoSession as active or inactive, which represents if the session is currently visible or not.void
setAutofillDelegate
(Autofill.Delegate delegate) Sets the autofill delegate for this session.void
Set the content blocking callback handler.void
Set the content callback handler.void
setExperimentDelegate
(ExperimentDelegate delegate) Sets the experiment delegate for this session.void
setFocused
(boolean focused) Move focus to this session or away from this session.void
Set the history tracking delegate for this session, replacing the current delegate if one is set.void
setMediaDelegate
(GeckoSession.MediaDelegate delegate) Set the media callback handler.void
setMediaSessionDelegate
(MediaSession.Delegate delegate) Set the media session delegate.void
Set the navigation callback handler.void
Set the current permission delegate for this GeckoSession.void
setPrintDelegate
(GeckoSession.PrintDelegate delegate) Sets the print delegate for this session.void
setPriorityHint
(int priorityHint) Notify GeckoView of the priority for this GeckoSession.void
Set the progress callback handler.void
setPromptDelegate
(GeckoSession.PromptDelegate delegate) Set the current prompt delegate for this GeckoSession.void
setScrollDelegate
(GeckoSession.ScrollDelegate delegate) Set the content scroll callback handler.void
Set the current selection action delegate for this GeckoSession.protected void
setShouldPinOnScreen
(boolean pinned) void
Set the translation delegate, which receives translations events.void
stop()
Stop loading.
-
Field Details
-
mWindow
@Nullable protected org.mozilla.geckoview.GeckoSession.Window mWindow -
PRIORITY_DEFAULT
public static final int PRIORITY_DEFAULTValue for Priority when it is default.- See Also:
-
PRIORITY_HIGH
public static final int PRIORITY_HIGHValue for Priority when it is high.- See Also:
-
LOAD_FLAGS_NONE
public static final int LOAD_FLAGS_NONEDefault load flag, no special considerations.- See Also:
-
LOAD_FLAGS_BYPASS_CACHE
public static final int LOAD_FLAGS_BYPASS_CACHEBypass the cache.- See Also:
-
LOAD_FLAGS_BYPASS_PROXY
public static final int LOAD_FLAGS_BYPASS_PROXYBypass the proxy, if one has been configured.- See Also:
-
LOAD_FLAGS_EXTERNAL
public static final int LOAD_FLAGS_EXTERNALThe load is coming from an external app. Perform additional checks.- See Also:
-
LOAD_FLAGS_ALLOW_POPUPS
public static final int LOAD_FLAGS_ALLOW_POPUPSPopup blocking will be disabled for this load- See Also:
-
LOAD_FLAGS_BYPASS_CLASSIFIER
public static final int LOAD_FLAGS_BYPASS_CLASSIFIERBypass the URI classifier (content blocking and Safe Browsing).- See Also:
-
LOAD_FLAGS_FORCE_ALLOW_DATA_URI
public static final int LOAD_FLAGS_FORCE_ALLOW_DATA_URIAllows a top-level data: navigation to occur. E.g. view-image is an explicit user action which should be allowed.- See Also:
-
LOAD_FLAGS_REPLACE_HISTORY
public static final int LOAD_FLAGS_REPLACE_HISTORYThis flag specifies that any existing history entry should be replaced.- See Also:
-
LOAD_FLAGS_BYPASS_LOAD_URI_DELEGATE
public static final int LOAD_FLAGS_BYPASS_LOAD_URI_DELEGATEThis load should bypass the NavigationDelegate.onLoadRequest.- See Also:
-
HEADER_FILTER_CORS_SAFELISTED
public static final int HEADER_FILTER_CORS_SAFELISTEDFilter headers according to the CORS safelisted rules.- See Also:
-
HEADER_FILTER_UNRESTRICTED_UNSAFE
public static final int HEADER_FILTER_UNRESTRICTED_UNSAFEAllows most headers.Note: the
Host
andConnection
headers are still ignored.This should only be used when input is hard-coded from the app or when properly sanitized, as some headers could cause unexpected consequences and security issues.
Only use this if you know what you're doing.
- See Also:
-
FINDER_FIND_FORWARD
public static final int FINDER_FIND_FORWARDGo forward when finding the next match.- See Also:
-
FINDER_FIND_BACKWARDS
public static final int FINDER_FIND_BACKWARDSGo backwards when finding the next match.- See Also:
-
FINDER_FIND_MATCH_CASE
public static final int FINDER_FIND_MATCH_CASEPerform case-sensitive match; default is to perform a case-insensitive match.- See Also:
-
FINDER_FIND_WHOLE_WORD
public static final int FINDER_FIND_WHOLE_WORDMust match entire words; default is to allow matching partial words.- See Also:
-
FINDER_FIND_LINKS_ONLY
public static final int FINDER_FIND_LINKS_ONLYLimit matches to links on the page.- See Also:
-
FINDER_DISPLAY_HIGHLIGHT_ALL
public static final int FINDER_DISPLAY_HIGHLIGHT_ALLHighlight all find-in-page matches.- See Also:
-
FINDER_DISPLAY_DIM_PAGE
public static final int FINDER_DISPLAY_DIM_PAGEDim the rest of the page when showing a find-in-page match.- See Also:
-
FINDER_DISPLAY_DRAW_LINK_OUTLINE
public static final int FINDER_DISPLAY_DRAW_LINK_OUTLINEDraw outlines around matching links.- See Also:
-
-
Constructor Details
-
GeckoSession
public GeckoSession() -
GeckoSession
-
-
Method Details
-
getUserAgent
Get the current user agent string for this GeckoSession.- Returns:
- a
GeckoResult
containing the UserAgent string
-
getDefaultUserAgent
Get the default user agent for this GeckoView build.This method does not account for any override that might have been applied to the user agent string.
- Returns:
- the default user agent string
-
getPermissionDelegate
Get the current permission delegate for this GeckoSession.- Returns:
- PermissionDelegate instance or null if using default delegate.
-
setPermissionDelegate
Set the current permission delegate for this GeckoSession.- Parameters:
delegate
- PermissionDelegate instance or null to use the default delegate.
-
isOpen
@UiThread public boolean isOpen()Return whether this session is open.- Returns:
- True if session is open.
- See Also:
-
open
Opens the session.Call this when you are ready to use a GeckoSession instance.
The session is in a 'closed' state when first created. Opening it creates the underlying Gecko objects necessary to load a page, etc. Most GeckoSession methods only take affect on an open session, and are queued until the session is opened here. Opening a session is an asynchronous operation.
-
close
@UiThread public void close()Closes the session.This frees the underlying Gecko objects and unloads the current page. The session may be reopened later, but page state is not restored. Call this when you are finished using a GeckoSession instance.
-
getTextInput
Get the SessionTextInput instance for this session. May be called on any thread.- Returns:
- SessionTextInput instance.
-
getAccessibility
Get the SessionAccessibility instance for this session.- Returns:
- SessionAccessibility instance.
-
load
Load page using theGeckoSession.Loader
specified.- Parameters:
request
- Loader for this request.- See Also:
-
loadUri
Load the given URI.Convenience method for
session.load(new Loader().uri(uri));
- Parameters:
uri
- The URI of the resource to load.
-
reload
@AnyThread public void reload()Reload the current URI. -
reload
@AnyThread public void reload(int flags) Reload the current URI.- Parameters:
flags
- the load flags to use, an OR-ed value ofLOAD_FLAGS_*
-
stop
@AnyThread public void stop()Stop loading. -
goBack
@AnyThread public void goBack()Go back in history and assumes the call was based on a user interaction.- See Also:
-
goBack
@AnyThread public void goBack(boolean userInteraction) Go back in history.- Parameters:
userInteraction
- Whether the action was invoked by a user interaction.
-
goForward
@AnyThread public void goForward()Go forward in history and assumes the call was based on a user interaction.- See Also:
-
goForward
@AnyThread public void goForward(boolean userInteraction) Go forward in history.- Parameters:
userInteraction
- Whether the action was invoked by a user interaction.
-
gotoHistoryIndex
@AnyThread public void gotoHistoryIndex(int index) Navigate to an index in browser history; the index of the currently viewed page can be retrieved from an up-to-date HistoryList by callingGeckoSession.HistoryDelegate.HistoryList.getCurrentIndex()
.- Parameters:
index
- The index of the location in browser history you want to navigate to.
-
getWebExtensionController
Returns a WebExtensionController for this GeckoSession. Delegates attached to this controller will receive events specific to this session.- Returns:
- an instance of
WebExtension.SessionController
.
-
purgeHistory
@AnyThread public void purgeHistory()Purge history for the session. The session history is used for back and forward history. Purging the session history meansGeckoSession.NavigationDelegate.onCanGoBack(GeckoSession, boolean)
andGeckoSession.NavigationDelegate.onCanGoForward(GeckoSession, boolean)
will be false. -
getFinder
Get the SessionFinder instance for this session, to perform find-in-page operations.- Returns:
- SessionFinder instance.
-
hasCookieBannerRuleForBrowsingContextTree
Checks whether we have a rule for this session. Uses the browsing context or any of its children, calls nsICookieBannerService.hasRuleForBrowsingContextTree- Returns:
GeckoResult
with boolean
-
getPdfFileSaver
Get the SessionPdfFileSaver instance for this session, to save a pdf document.- Returns:
- SessionPdfFileSaver instance.
-
isPdfJs
Check if the document being viewed is a pdf.- Returns:
- Result of the check operation as a
GeckoResult
object.
-
setActive
@AnyThread public void setActive(boolean active) Set this GeckoSession as active or inactive, which represents if the session is currently visible or not. Setting a GeckoSession to inactive will significantly reduce its memory footprint, but should only be done if the GeckoSession is not currently visible. Note that a session can be active (i.e. visible) but not focused. When a session is set inactive, it will flush the session state and trigger a `ProgressDelegate.onSessionStateChange` callback.- Parameters:
active
- A boolean determining whether the GeckoSession is active.- See Also:
-
setFocused
@AnyThread public void setFocused(boolean focused) Move focus to this session or away from this session. Only one session has focus at a given time. Note that a session can be unfocused but still active (i.e. visible).- Parameters:
focused
- True if the session should gain focus or false if the session should lose focus.- See Also:
-
setPriorityHint
@AnyThread public void setPriorityHint(int priorityHint) Notify GeckoView of the priority for this GeckoSession.Set this GeckoSession to high priority (PRIORITY_HIGH) whenever the app wants to signal to GeckoView that this GeckoSession is important to the app. GeckoView will keep the session state as long as possible. Set this to default priority (PRIORITY_DEFAULT) in any other case.
- Parameters:
priorityHint
- Priority of the geckosession, either high priority or default.
-
restoreState
Restore a saved state to this GeckoSession; only data that is saved (history, scroll position, zoom, and form data) will be restored. These will overwrite the corresponding state of this GeckoSession.- Parameters:
state
- A saved session state; this should originate from onSessionStateChange().
-
containsFormData
Get whether this GeckoSession has form data.- Returns:
- a
GeckoResult
result of if there is existing form data.
-
requestAnalysis
@AnyThread @NonNull public GeckoResult<GeckoSession.ReviewAnalysis> requestAnalysis(@NonNull String url) Request analysis of product's reviews for a given product URL.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of review analysis object.
-
requestCreateAnalysis
Request the creation of an analysis of product's reviews for a given product URL.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of status of analysis.
-
requestAnalysisStatus
@AnyThread @NonNull public GeckoResult<GeckoSession.AnalysisStatusResponse> requestAnalysisStatus(@NonNull String url) Request the status of the current analysis of product's reviews for a given product URL.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of status of analysis.
-
pollForAnalysisCompleted
Poll for the status of the current analysis of product's reviews for a given product URL.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of status of analysis.
-
sendClickAttributionEvent
Send a click event to the Ad Attribution API.- Parameters:
aid
- Ad id of the recommended product.- Returns:
- a
GeckoResult
result of whether or not sending the event was successful.
-
sendImpressionAttributionEvent
Send an impression event to the Ad Attribution API.- Parameters:
aid
- Ad id of the recommended product.- Returns:
- a
GeckoResult
result of whether or not sending the event was successful.
-
sendPlacementAttributionEvent
Send a placement event to the Ad Attribution API.- Parameters:
aid
- Ad id of the recommended product.- Returns:
- a
GeckoResult
result of whether or not sending the event was successful.
-
requestRecommendations
@AnyThread @NonNull public GeckoResult<List<GeckoSession.Recommendation>> requestRecommendations(@NonNull String url) Request product recommendations given a specific product url.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of product recommendations.
-
reportBackInStock
Report that a product is back in stock.- Parameters:
url
- The URL of the product page.- Returns:
- a
GeckoResult
result of whether reporting a product is back in stock was successful.
-
getWebCompatInfo
Get the web compatibility info when a site is reported as broken.- Returns:
- a
GeckoResult
containing the WebCompatInfo as a JSONObject.
-
acquireDisplay
Acquire the GeckoDisplay instance for providing the session with a drawing Surface. Be sure to callGeckoDisplay.surfaceChanged(SurfaceInfo)
on the acquired display if there is already a valid Surface.- Returns:
- GeckoDisplay instance.
- See Also:
-
releaseDisplay
Release an acquired GeckoDisplay instance. Be sure to callGeckoDisplay.surfaceDestroyed()
before releasing the display if it still has a valid Surface.- Parameters:
display
- Acquired GeckoDisplay instance.- See Also:
-
getSettings
-
exitFullScreen
@AnyThread public void exitFullScreen()Exits fullscreen mode -
setContentDelegate
Set the content callback handler. This will replace the current handler.- Parameters:
delegate
- An implementation of ContentDelegate.
-
getContentDelegate
Get the content callback handler.- Returns:
- The current content callback handler.
-
setProgressDelegate
Set the progress callback handler. This will replace the current handler.- Parameters:
delegate
- An implementation of ProgressDelegate.
-
getProgressDelegate
Get the progress callback handler.- Returns:
- The current progress callback handler.
-
setScrollDelegate
Set the content scroll callback handler. This will replace the current handler.- Parameters:
delegate
- An implementation of ScrollDelegate.
-
getScrollDelegate
-
setHistoryDelegate
Set the history tracking delegate for this session, replacing the current delegate if one is set.- Parameters:
delegate
- The history tracking delegate, ornull
to unset.
-
getHistoryDelegate
- Returns:
- The history tracking delegate for this session.
-
setContentBlockingDelegate
Set the content blocking callback handler. This will replace the current handler.- Parameters:
delegate
- An implementation ofContentBlocking.Delegate
.
-
getContentBlockingDelegate
Get the content blocking callback handler.- Returns:
- The current content blocking callback handler.
-
setPromptDelegate
Set the current prompt delegate for this GeckoSession.- Parameters:
delegate
- PromptDelegate instance or null to use the built-in delegate.
-
getPromptDelegate
Get the current prompt delegate for this GeckoSession.- Returns:
- PromptDelegate instance or null if using built-in delegate.
-
setSelectionActionDelegate
@UiThread public void setSelectionActionDelegate(@Nullable GeckoSession.SelectionActionDelegate delegate) Set the current selection action delegate for this GeckoSession.- Parameters:
delegate
- SelectionActionDelegate instance or null to unset.
-
setMediaDelegate
Set the media callback handler. This will replace the current handler.- Parameters:
delegate
- An implementation of MediaDelegate.
-
getMediaDelegate
Get the Media callback handler.- Returns:
- The current Media callback handler.
-
setMediaSessionDelegate
Set the media session delegate. This will replace the current handler.- Parameters:
delegate
- An implementation ofMediaSession.Delegate
.
-
getMediaSessionDelegate
Get the media session delegate.- Returns:
- The current media session delegate.
-
getSessionTranslation
The session translation object coordinates receiving and sending session messages with the translations toolkit. Notably, it can be used to request translations.- Returns:
- The current translation session coordinator.
-
setTranslationsSessionDelegate
@AnyThread public void setTranslationsSessionDelegate(@Nullable TranslationsController.SessionTranslation.Delegate delegate) Set the translation delegate, which receives translations events.- Parameters:
delegate
- An implementation of @link{TranslationsController.SessionTranslation.Delegate}.
-
getTranslationsSessionDelegate
@AnyThread @Nullable public TranslationsController.SessionTranslation.Delegate getTranslationsSessionDelegate()Get the translations delegate. The application embedder must initially set the translations delegate for use.- Returns:
- The current translations delegate.
-
getSelectionActionDelegate
Get the current selection action delegate for this GeckoSession.- Returns:
- SelectionActionDelegate instance or null if not set.
-
setShouldPinOnScreen
@UiThread protected void setShouldPinOnScreen(boolean pinned) -
getPanZoomController
Get the PanZoomController instance for this session.- Returns:
- PanZoomController instance.
-
getOverscrollEdgeEffect
Get the OverscrollEdgeEffect instance for this session.- Returns:
- OverscrollEdgeEffect instance.
-
getCompositorController
Get the CompositorController instance for this session.- Returns:
- CompositorController instance.
-
getClientToSurfaceMatrix
Get a matrix for transforming from client coordinates to surface coordinates.- Parameters:
matrix
- Matrix to be replaced by the transformation matrix.- See Also:
-
getClientToScreenMatrix
Get a matrix for transforming from client coordinates to screen coordinates. The client coordinates are in CSS pixels and are relative to the viewport origin; their relation to screen coordinates does not depend on the current scroll position.- Parameters:
matrix
- Matrix to be replaced by the transformation matrix.- See Also:
-
getPageToScreenMatrix
Get a matrix for transforming from page coordinates to screen coordinates. The page coordinates are in CSS pixels and are relative to the page origin; their relation to screen coordinates depends on the current scroll position of the outermost frame.- Parameters:
matrix
- Matrix to be replaced by the transformation matrix.- See Also:
-
getPageToSurfaceMatrix
Get a matrix for transforming from page coordinates to surface coordinates.- Parameters:
matrix
- Matrix to be replaced by the transformation matrix.- See Also:
-
getClientBounds
Get the bounds of the client area in client coordinates. The returned top-left coordinates are always (0, 0). Use the matrix fromgetClientToSurfaceMatrix(Matrix)
orgetClientToScreenMatrix(Matrix)
to map these bounds to surface or screen coordinates, respectively.- Parameters:
rect
- RectF to be replaced by the client bounds in client coordinates.- See Also:
-
getSurfaceBounds
Get the bounds of the client area in surface coordinates. This is equivalent to mapping the bounds returned by #getClientBounds(RectF) with the matrix returned by #getClientToSurfaceMatrix(Matrix).- Parameters:
rect
- Rect to be replaced by the client bounds in surface coordinates.
-
setAutofillDelegate
Sets the autofill delegate for this session.- Parameters:
delegate
- An instance ofAutofill.Delegate
.
-
getAutofillDelegate
- Returns:
- The current
Autofill.Delegate
for this session, if any.
-
getAutofillSession
Provides an autofill structure similar toView.onProvideAutofillVirtualStructure(ViewStructure, int)
, but does not rely onViewStructure
to build the tree. This is useful for apps that want to provide autofill functionality without using the Android autofill system or requiring API 26.- Returns:
- The elements available for autofill.
-
saveAsPdf
Saves a PDF of the currently displayed page.- Returns:
- A GeckoResult with an InputStream containing the PDF. The result could
CompleteExceptionally with a
GeckoSession.GeckoPrintException
s, if there are any issues while generating the PDF.
-
printPageContent
@AnyThread public void printPageContent()Prints the currently displayed page. -
didPrintPageContent
Prints the currently displayed page and provides dialog finished status or if an exception occured.- Returns:
- if the printing dialog finished or an exception.
-
getPrintDelegate
Gets the print delegate for this session.- Returns:
- The current
GeckoSession.PrintDelegate
for this session, if any.
-
setPrintDelegate
Sets the print delegate for this session.- Parameters:
delegate
- An instance ofGeckoSession.PrintDelegate
.
-
getExperimentDelegate
Gets the experiment delegate for this session.- Returns:
- The current
ExperimentDelegate
for this session, if any.
-
setExperimentDelegate
Sets the experiment delegate for this session. Default is set to the runtime experiment delegate.- Parameters:
delegate
- An instance ofExperimentDelegate
.
-