@AnyThread public static final class GeckoSessionSettings.Builder extends Object
Constructor and Description |
---|
Builder() |
Builder(GeckoSessionSettings settings) |
Modifier and Type | Method and Description |
---|---|
GeckoSessionSettings.Builder |
allowJavascript(boolean flag)
Set whether JavaScript support should be enabled.
|
GeckoSessionSettings |
build()
Finalize and return the settings.
|
GeckoSessionSettings.Builder |
chromeUri(String uri)
Set the chrome URI.
|
GeckoSessionSettings.Builder |
contextId(String value)
Set the session context ID for this instance.
|
GeckoSessionSettings.Builder |
displayMode(int mode)
Specify which display-mode to use.
|
GeckoSessionSettings.Builder |
fullAccessibilityTree(boolean flag)
Set whether the entire accessible tree should be exposed with no caching.
|
GeckoSessionSettings.Builder |
screenId(int id)
Set the screen id.
|
GeckoSessionSettings.Builder |
suspendMediaWhenInactive(boolean flag)
Set whether to suspend the playing of media when the session is inactive.
|
GeckoSessionSettings.Builder |
usePrivateMode(boolean flag)
Set the privacy mode for this instance.
|
GeckoSessionSettings.Builder |
userAgentMode(int mode)
Set the user agent mode.
|
GeckoSessionSettings.Builder |
userAgentOverride(String agent)
Override the user agent.
|
GeckoSessionSettings.Builder |
useTrackingProtection(boolean flag)
Set whether tracking protection should be enabled.
|
GeckoSessionSettings.Builder |
viewportMode(int mode)
Specify which viewport mode to use.
|
public Builder()
public Builder(GeckoSessionSettings settings)
@NonNull public GeckoSessionSettings build()
@NonNull public GeckoSessionSettings.Builder chromeUri(@NonNull String uri)
uri
- The URI to set the Chrome URI to.@NonNull public GeckoSessionSettings.Builder screenId(int id)
id
- The screen id.@NonNull public GeckoSessionSettings.Builder usePrivateMode(boolean flag)
flag
- A flag determining whether Private Mode should be enabled.
Default is false.@NonNull public GeckoSessionSettings.Builder contextId(@Nullable String value)
StorageController.clearDataForSessionContext(java.lang.String)
for the given context.value
- The custom context ID.
The default ID is null, which removes isolation for this
instance.@NonNull public GeckoSessionSettings.Builder useTrackingProtection(boolean flag)
flag
- A flag determining whether tracking protection should be enabled.
Default is false.@NonNull public GeckoSessionSettings.Builder userAgentMode(int mode)
mode
- The mode to set the user agent to.
Use one or more of the
GeckoSessionSettings.USER_AGENT_MODE_*
flags.@NonNull public GeckoSessionSettings.Builder userAgentOverride(@NonNull String agent)
agent
- The user agent to use.@NonNull public GeckoSessionSettings.Builder displayMode(int mode)
mode
- The mode to set the display to.
Use one or more of the
GeckoSessionSettings.DISPLAY_MODE_*
flags.@NonNull public GeckoSessionSettings.Builder suspendMediaWhenInactive(boolean flag)
flag
- A flag determining whether media should be suspended.
Default is false.@NonNull public GeckoSessionSettings.Builder allowJavascript(boolean flag)
flag
- A flag determining whether JavaScript should be enabled.
Default is true.@NonNull public GeckoSessionSettings.Builder fullAccessibilityTree(boolean flag)
flag
- A flag determining if the entire accessible tree should be exposed.
Default is false.@NonNull public GeckoSessionSettings.Builder viewportMode(int mode)
mode
- The mode to set the viewport to.
Use one or more of the
GeckoSessionSettings.VIEWPORT_MODE_*
flags.