Package org.mozilla.geckoview
Class GeckoSessionSettings.Builder
Object
org.mozilla.geckoview.GeckoSessionSettings.Builder
- Enclosing class:
- GeckoSessionSettings
Settings builder used to construct the settings object.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowJavascript
(boolean flag) Set whether JavaScript support should be enabled.build()
Finalize and return the settings.Set the chrome URI.Set the session context ID for this instance.displayMode
(int mode) Specify which display-mode to use.fullAccessibilityTree
(boolean flag) Set whether the entire accessible tree should be exposed with no caching.screenId
(int id) Set the screen id.suspendMediaWhenInactive
(boolean flag) Set whether to suspend the playing of media when the session is inactive.usePrivateMode
(boolean flag) Set the privacy mode for this instance.userAgentMode
(int mode) Set the user agent mode.userAgentOverride
(String agent) Override the user agent.useTrackingProtection
(boolean flag) Set whether tracking protection should be enabled.viewportMode
(int mode) Specify which viewport mode to use.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
build
Finalize and return the settings.- Returns:
- The constructed settings.
-
chromeUri
Set the chrome URI.- Parameters:
uri
- The URI to set the Chrome URI to.- Returns:
- This Builder instance.
-
screenId
Set the screen id.- Parameters:
id
- The screen id.- Returns:
- This Builder instance.
-
usePrivateMode
Set the privacy mode for this instance.- Parameters:
flag
- A flag determining whether Private Mode should be enabled. Default is false.- Returns:
- This Builder instance.
-
contextId
Set the session context ID for this instance. Setting a context ID partitions the cookie jars based on the provided IDs. This isolates the browser storage like cookies and localStorage between sessions, only sessions that share the same ID share storage data.Warning: Storage data is collected persistently for each context, to delete context data, call
StorageController.clearDataForSessionContext(java.lang.String)
for the given context.- Parameters:
value
- The custom context ID. The default ID is null, which removes isolation for this instance.- Returns:
- This Builder instance.
-
useTrackingProtection
Set whether tracking protection should be enabled.- Parameters:
flag
- A flag determining whether tracking protection should be enabled. Default is false.- Returns:
- This Builder instance.
-
userAgentMode
Set the user agent mode.- Parameters:
mode
- The mode to set the user agent to. Use one or more of theGeckoSessionSettings.USER_AGENT_MODE_*
flags.- Returns:
- This Builder instance.
-
userAgentOverride
Override the user agent.- Parameters:
agent
- The user agent to use.- Returns:
- This Builder instance.
-
displayMode
Specify which display-mode to use.- Parameters:
mode
- The mode to set the display to. Use one or more of theGeckoSessionSettings.DISPLAY_MODE_*
flags.- Returns:
- This Builder instance.
-
suspendMediaWhenInactive
Set whether to suspend the playing of media when the session is inactive.- Parameters:
flag
- A flag determining whether media should be suspended. Default is false.- Returns:
- This Builder instance.
-
allowJavascript
Set whether JavaScript support should be enabled.- Parameters:
flag
- A flag determining whether JavaScript should be enabled. Default is true.- Returns:
- This Builder instance.
-
fullAccessibilityTree
Set whether the entire accessible tree should be exposed with no caching.- Parameters:
flag
- A flag determining if the entire accessible tree should be exposed. Default is false.- Returns:
- This Builder instance.
-
viewportMode
Specify which viewport mode to use.- Parameters:
mode
- The mode to set the viewport to. Use one or more of theGeckoSessionSettings.VIEWPORT_MODE_*
flags.- Returns:
- This Builder instance.
-