Package org.mozilla.geckoview
Class GeckoSessionSettings
Object
org.mozilla.geckoview.GeckoSessionSettings
- All Implemented Interfaces:
Parcelable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Settings builder used to construct the settings object.static @interface
This value is for the display member of Web App Manifestsstatic class
static @interface
The user agent string modestatic @interface
The view port modeNested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Parcelable.Creator<GeckoSessionSettings>
static final int
"browser" value of the display member in Web App Manifestsstatic final int
"fullscreen" value of the display member in Web App Manifestsstatic final int
"minimal-ui" value of the display member in Web App Manifestsstatic final int
"standalone" value of the display member in Web App Manifestsstatic final int
The user agent mobe is desktop devicestatic final int
The user agent mode is mobile devicestatic final int
The user agent mode is VR devicestatic final int
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 final int
Mobile-friendly pages will be rendered using a viewport based on their <meta> viewport tag.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
Whether javascript execution is allowed.Set the chrome window URI.The context ID for this session.int
The current display mode.boolean
Whether entire accessible tree is exposed with no caching.int
Set the window screen ID.boolean
Whether media will be suspended when the session is inactice.boolean
Whether private mode is enabled.int
The current user agent ModeThe user agent override string.boolean
Whether tracking protection is enabled.int
The current viewport Modeint
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 usevoid
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 usetoString()
void
writeToParcel
(Parcel out, int flags)
-
Field Details
-
DISPLAY_MODE_BROWSER
public static final int DISPLAY_MODE_BROWSER"browser" value of the display member in Web App Manifests- See Also:
-
DISPLAY_MODE_MINIMAL_UI
public static final int DISPLAY_MODE_MINIMAL_UI"minimal-ui" value of the display member in Web App Manifests- See Also:
-
DISPLAY_MODE_STANDALONE
public static final int DISPLAY_MODE_STANDALONE"standalone" value of the display member in Web App Manifests- See Also:
-
DISPLAY_MODE_FULLSCREEN
public static final int DISPLAY_MODE_FULLSCREEN"fullscreen" value of the display member in Web App Manifests- See Also:
-
USER_AGENT_MODE_MOBILE
public static final int USER_AGENT_MODE_MOBILEThe user agent mode is mobile device- See Also:
-
USER_AGENT_MODE_DESKTOP
public static final int USER_AGENT_MODE_DESKTOPThe user agent mobe is desktop device- See Also:
-
USER_AGENT_MODE_VR
public static final int USER_AGENT_MODE_VRThe user agent mode is VR device- See Also:
-
VIEWPORT_MODE_MOBILE
public static final int VIEWPORT_MODE_MOBILEMobile-friendly pages will be rendered using a viewport based on their <meta> viewport tag. All other pages will be rendered using a special desktop mode viewport, which has a width of 980 CSS px.- See Also:
-
VIEWPORT_MODE_DESKTOP
public static final int VIEWPORT_MODE_DESKTOPAll 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.- See Also:
-
CREATOR
-
-
Constructor Details
-
GeckoSessionSettings
public GeckoSessionSettings() -
GeckoSessionSettings
-
-
Method Details
-
setUseTrackingProtection
public void setUseTrackingProtection(boolean value) Set whether tracking protection should be enabled.- Parameters:
value
- A flag determining whether tracking protection should be enabled. Default is false.
-
setSuspendMediaWhenInactive
public void setSuspendMediaWhenInactive(boolean value) Set whether to suspend the playing of media when the session is inactive.- Parameters:
value
- A flag determining whether media should be suspended. Default is false.
-
setAllowJavascript
public void setAllowJavascript(boolean value) Set whether JavaScript support should be enabled.- Parameters:
value
- A flag determining whether JavaScript should be enabled. Default is true.
-
setFullAccessibilityTree
public void setFullAccessibilityTree(boolean value) Set whether the entire accessible tree should be exposed with no caching.- Parameters:
value
- A flag determining full accessibility tree should be exposed. Default is false.
-
getUseTrackingProtection
public boolean getUseTrackingProtection()Whether tracking protection is enabled.- Returns:
- true if tracking protection is enabled, false if not.
-
getUsePrivateMode
public boolean getUsePrivateMode()Whether private mode is enabled.- Returns:
- true if private mode is enabled, false if not.
-
getContextId
The context ID for this session.- Returns:
- The context ID for this session.
-
getSuspendMediaWhenInactive
public boolean getSuspendMediaWhenInactive()Whether media will be suspended when the session is inactice.- Returns:
- true if media will be suspended, false if not.
-
getAllowJavascript
public boolean getAllowJavascript()Whether javascript execution is allowed.- Returns:
- true if javascript execution is allowed, false if not.
-
getFullAccessibilityTree
public boolean getFullAccessibilityTree()Whether entire accessible tree is exposed with no caching.- Returns:
- true if accessibility tree is exposed, false if not.
-
setUserAgentMode
public void setUserAgentMode(int value) Specify which user agent mode we should use- Parameters:
value
- One or more of theGeckoSessionSettings.USER_AGENT_MODE_*
flags.
-
setDisplayMode
public void setDisplayMode(int value) Set the display mode.- Parameters:
value
- The mode to set the display to. Use one or more of theGeckoSessionSettings.DISPLAY_MODE_*
flags.
-
setViewportMode
public void setViewportMode(int value) Specify which viewport mode we should use- Parameters:
value
- One or more of theGeckoSessionSettings.VIEWPORT_MODE_*
flags.
-
getScreenId
public int getScreenId()Set the window screen ID. Read-only once session is open. Use theGeckoSessionSettings.Builder
to set on session open.- Returns:
- Key to set the window screen ID. 0 is the default ID.
-
getUserAgentMode
public int getUserAgentMode()The current user agent Mode- Returns:
- One or more of the
GeckoSessionSettings.USER_AGENT_MODE_*
flags.
-
getDisplayMode
public int getDisplayMode()The current display mode.- Returns:
- One or more of the
GeckoSessionSettings.DISPLAY_MODE_*
flags.
-
getViewportMode
public int getViewportMode()The current viewport Mode- Returns:
- One or more of the
GeckoSessionSettings.VIEWPORT_MODE_*
flags.
-
setUserAgentOverride
Specify the user agent override string. Set value to null to use the user agent specified by USER_AGENT_MODE.- Parameters:
value
- The string to override the user agent with.
-
getChromeUri
Set the chrome window URI. Read-only once session is open. Use theGeckoSessionSettings.Builder
to set on session open.- Returns:
- Key to set the chrome window URI, or null to use default URI.
-
getUserAgentOverride
The user agent override string.- Returns:
- The current user agent string or null if the agent is specified by
USER_AGENT_MODE
-
toString
-
equals
-
hashCode
public int hashCode() -
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceParcelable
-
writeToParcel
- Specified by:
writeToParcel
in interfaceParcelable
-
readFromParcel
-