@AnyThread public final class GeckoSessionSettings extends Object implements Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
GeckoSessionSettings.Builder
Settings builder used to construct the settings object.
|
static class |
GeckoSessionSettings.Key<T> |
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<GeckoSessionSettings> |
CREATOR |
static int |
DISPLAY_MODE_BROWSER |
static int |
DISPLAY_MODE_FULLSCREEN |
static int |
DISPLAY_MODE_MINIMAL_UI |
static int |
DISPLAY_MODE_STANDALONE |
static int |
USER_AGENT_MODE_DESKTOP |
static int |
USER_AGENT_MODE_MOBILE |
static int |
USER_AGENT_MODE_VR |
static int |
VIEWPORT_MODE_DESKTOP
All pages will be rendered using the special desktop mode viewport, which has a width of
980 CSS px, regardless of whether the page has a <meta> viewport tag specified or not.
|
static int |
VIEWPORT_MODE_MOBILE
Mobile-friendly pages will be rendered using a viewport based on their <meta> viewport
tag.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
GeckoSessionSettings() |
GeckoSessionSettings(GeckoSessionSettings settings) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(Object other) |
boolean |
getAllowJavascript()
Whether javascript execution is allowed.
|
String |
getChromeUri()
Set the chrome window URI.
|
String |
getContextId()
The context ID for this session.
|
int |
getDisplayMode()
The current display mode.
|
boolean |
getFullAccessibilityTree()
Whether entire accessible tree is exposed with no caching.
|
int |
getScreenId()
Set the window screen ID.
|
boolean |
getSuspendMediaWhenInactive()
Whether media will be suspended when the session is inactice.
|
boolean |
getUsePrivateMode()
Whether private mode is enabled.
|
int |
getUserAgentMode()
The current user agent Mode
|
String |
getUserAgentOverride()
The user agent override string.
|
boolean |
getUseTrackingProtection()
Whether tracking protection is enabled.
|
int |
getViewportMode()
The current viewport Mode
|
int |
hashCode() |
void |
readFromParcel(Parcel source) |
void |
setAllowJavascript(boolean value)
Set whether JavaScript support should be enabled.
|
void |
setDisplayMode(int value)
Set the display mode.
|
void |
setFullAccessibilityTree(boolean value)
Set whether the entire accessible tree should be exposed with no caching.
|
void |
setSuspendMediaWhenInactive(boolean value)
Set whether to suspend the playing of media when the session is inactive.
|
void |
setUserAgentMode(int value)
Specify which user agent mode we should use
|
void |
setUserAgentOverride(String value)
Specify the user agent override string.
|
void |
setUseTrackingProtection(boolean value)
Set whether tracking protection should be enabled.
|
void |
setViewportMode(int value)
Specify which viewport mode we should use
|
String |
toString() |
void |
writeToParcel(Parcel out,
int flags) |
public static final int DISPLAY_MODE_BROWSER
public static final int DISPLAY_MODE_MINIMAL_UI
public static final int DISPLAY_MODE_STANDALONE
public static final int DISPLAY_MODE_FULLSCREEN
public static final int USER_AGENT_MODE_MOBILE
public static final int USER_AGENT_MODE_DESKTOP
public static final int USER_AGENT_MODE_VR
public static final int VIEWPORT_MODE_MOBILE
public static final int VIEWPORT_MODE_DESKTOP
public static final Parcelable.Creator<GeckoSessionSettings> CREATOR
public GeckoSessionSettings()
public GeckoSessionSettings(@NonNull GeckoSessionSettings settings)
public void setUseTrackingProtection(boolean value)
value
- A flag determining whether tracking protection should be enabled.
Default is false.public void setSuspendMediaWhenInactive(boolean value)
value
- A flag determining whether media should be suspended.
Default is false.public void setAllowJavascript(boolean value)
value
- A flag determining whether JavaScript should be enabled.
Default is true.public void setFullAccessibilityTree(boolean value)
value
- A flag determining full accessibility tree should be exposed.
Default is false.public boolean getUseTrackingProtection()
public boolean getUsePrivateMode()
@Nullable public String getContextId()
public boolean getSuspendMediaWhenInactive()
public boolean getAllowJavascript()
public boolean getFullAccessibilityTree()
public void setUserAgentMode(int value)
value
- One or more of the
GeckoSessionSettings.USER_AGENT_MODE_*
flags.public void setDisplayMode(int value)
value
- The mode to set the display to.
Use one or more of the
GeckoSessionSettings.DISPLAY_MODE_*
flags.public void setViewportMode(int value)
value
- One or more of the
GeckoSessionSettings.VIEWPORT_MODE_*
flags.public int getScreenId()
GeckoSessionSettings.Builder
to set on session open.public int getUserAgentMode()
GeckoSessionSettings.USER_AGENT_MODE_*
flags.public int getDisplayMode()
GeckoSessionSettings.DISPLAY_MODE_*
flags.public int getViewportMode()
GeckoSessionSettings.VIEWPORT_MODE_*
flags.public void setUserAgentOverride(@Nullable String value)
value
- The string to override the user agent with.@Nullable public String getChromeUri()
GeckoSessionSettings.Builder
to set on session open.@Nullable public String getUserAgentOverride()
USER_AGENT_MODE
public int describeContents()
describeContents
in interface Parcelable
public void writeToParcel(@NonNull Parcel out, int flags)
writeToParcel
in interface Parcelable
public void readFromParcel(@NonNull Parcel source)