Class GeckoSessionSettings

Object
org.mozilla.geckoview.GeckoSessionSettings
All Implemented Interfaces:
Parcelable

@AnyThread public final class GeckoSessionSettings extends Object implements Parcelable
  • 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_MOBILE
      The user agent mode is mobile device
      See Also:
    • USER_AGENT_MODE_DESKTOP

      public static final int USER_AGENT_MODE_DESKTOP
      The user agent mobe is desktop device
      See Also:
    • USER_AGENT_MODE_VR

      public static final int USER_AGENT_MODE_VR
      The user agent mode is VR device
      See Also:
    • VIEWPORT_MODE_MOBILE

      public static final int VIEWPORT_MODE_MOBILE
      Mobile-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_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.
      See Also:
    • CREATOR

      public static final Parcelable.Creator<GeckoSessionSettings> CREATOR
  • Constructor Details

    • GeckoSessionSettings

      public GeckoSessionSettings()
    • GeckoSessionSettings

      public GeckoSessionSettings(@NonNull GeckoSessionSettings settings)
  • 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

      @Nullable public String 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 the GeckoSessionSettings.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 the GeckoSessionSettings.DISPLAY_MODE_* flags.
    • setViewportMode

      public void setViewportMode(int value)
      Specify which viewport mode we should use
      Parameters:
      value - One or more of the GeckoSessionSettings.VIEWPORT_MODE_* flags.
    • getScreenId

      public int getScreenId()
      Set the window screen ID. Read-only once session is open. Use the GeckoSessionSettings.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

      public void setUserAgentOverride(@Nullable String value)
      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

      @Nullable public String getChromeUri()
      Set the chrome window URI. Read-only once session is open. Use the GeckoSessionSettings.Builder to set on session open.
      Returns:
      Key to set the chrome window URI, or null to use default URI.
    • getUserAgentOverride

      @Nullable public String getUserAgentOverride()
      The user agent override string.
      Returns:
      The current user agent string or null if the agent is specified by USER_AGENT_MODE
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface Parcelable
    • writeToParcel

      public void writeToParcel(@NonNull Parcel out, int flags)
      Specified by:
      writeToParcel in interface Parcelable
    • readFromParcel

      public void readFromParcel(@NonNull Parcel source)