Class GeckoRuntimeSettings
- All Implemented Interfaces:
Parcelable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Settings builder used to construct the settings object.static @interface
static @interface
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Allow all insecure connectionsstatic final int
A dark theme for web content is preferred.static final int
A light theme for web content is preferred.static final int
The preferred color scheme will be based on system settings.static final Parcelable.Creator<GeckoRuntimeSettings>
static final int
Only allow HTTPS connections.static final int
Allow insecure connections in normal browsing, but only HTTPS in private browsing.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether about:config is enabled or not.int
Get whether and where insecure (non-HTTPS) connections are allowed.String[]
Get the custom Gecko process arguments.boolean
Get whether or not the font sizes for web content are automatically adjusted to match the device's system font scale setting.Path to configuration file from which GeckoView will read configuration options such as Gecko process arguments, environment variables, and preferences.boolean
Get whether or not web console messages are sent to logcat.Gets the display density override value.Gets the display DPI override value.boolean
Gets whether double-tap zooming is enabled.boolean
Gets whether the Enteprise Roots feature is enabled or not.Get the custom Gecko intent extras.boolean
Get whether or not font inflation for non mobile-friendly pages is currently enabled.float
Gets the currently applied font size factor.boolean
Gets whether accessibility is force enabled or not.boolean
Gets whether or not force user scalable zooming should be enabled or not.int
Gets the current WebGL MSAA level.boolean
Gets whether auto-zoom to editable fields is enabled.boolean
Get whether JavaScript support is enabled.String[]
Gets the list of requested locales.boolean
Get whether login form autofill is enabled.boolean
Gets whether the pause-for-debugger is enabled or not.int
Gets the preferred color scheme override for web content.boolean
Get whether remote debugging support is enabled.Gets the screen size override value.boolean
Gets whether the compositor should use the maximum screen depth when rendering.boolean
Get whether web fonts support is enabled.boolean
Get whether or not Web Manifest processing support is enabled.void
readFromParcel
(Parcel source) setAboutConfigEnabled
(boolean flag) Sets whether or not about:config should be enabled.setAllowInsecureConnections
(int level) Set whether and where insecure (non-HTTPS) connections are allowed.setAutomaticFontSizeAdjustment
(boolean enabled) Set whether or not font sizes in web content should be automatically scaled according to the device's current system font scale setting.setConsoleOutputEnabled
(boolean enabled) Set whether or not web console messages should go to logcat.setDoubleTapZoomingEnabled
(boolean flag) Sets whether double tap zooming is enabled.setEnterpriseRootsEnabled
(boolean enabled) setFontInflationEnabled
(boolean enabled) Set whether or not font inflation for non mobile-friendly pages should be enabled.setFontSizeFactor
(float fontSizeFactor) Set a font size factor that will operate as a global text zoom.setForceEnableAccessibility
(boolean value) Sets whether accessibility is force enabled or not.setForceUserScalableEnabled
(boolean flag) Sets whether or not pinch-zooming should be enabled whenuser-scalable=no
is set on the viewport.setGlMsaaLevel
(int level) Sets the WebGL MSAA level.setInputAutoZoomEnabled
(boolean flag) Set whether auto-zoom to editable fields should be enabled.setJavaScriptEnabled
(boolean flag) Set whether JavaScript support should be enabled.void
setLocales
(String[] requestedLocales) Set the locale.setLoginAutofillEnabled
(boolean enabled) Set whether login forms should be filled automatically if only one viable candidate is provided viaonLoginFetch
.setPreferredColorScheme
(int scheme) Sets the preferred color scheme override for web content.setRemoteDebuggingEnabled
(boolean enabled) Set whether remote debugging support should be enabled.setWebFontsEnabled
(boolean flag) Set whether support for web fonts should be enabled.setWebManifestEnabled
(boolean enabled) Sets whether Web Manifest processing support is enabled.void
writeToParcel
(Parcel out, int flags) Methods inherited from class org.mozilla.geckoview.RuntimeSettings
describeContents, updatePrefs
-
Field Details
-
COLOR_SCHEME_LIGHT
public static final int COLOR_SCHEME_LIGHTA light theme for web content is preferred.- See Also:
-
COLOR_SCHEME_DARK
public static final int COLOR_SCHEME_DARKA dark theme for web content is preferred.- See Also:
-
COLOR_SCHEME_SYSTEM
public static final int COLOR_SCHEME_SYSTEMThe preferred color scheme will be based on system settings.- See Also:
-
ALLOW_ALL
public static final int ALLOW_ALLAllow all insecure connections- See Also:
-
HTTPS_ONLY_PRIVATE
public static final int HTTPS_ONLY_PRIVATEAllow insecure connections in normal browsing, but only HTTPS in private browsing.- See Also:
-
HTTPS_ONLY
public static final int HTTPS_ONLYOnly allow HTTPS connections.- See Also:
-
CREATOR
-
-
Method Details
-
getContentBlocking
-
getRuntime
-
getArguments
Get the custom Gecko process arguments.- Returns:
- The Gecko process arguments.
-
getExtras
Get the custom Gecko intent extras.- Returns:
- The Gecko intent extras.
-
getConfigFilePath
Path to configuration file from which GeckoView will read configuration options such as Gecko process arguments, environment variables, and preferences.Note: this feature is only available for
.Build.VERSION.SDK_INT
> 21- Returns:
- Path to configuration file from which GeckoView will read configuration options, or
null
for default location/data/local/tmp/$PACKAGE-geckoview-config.yaml
.
-
getJavaScriptEnabled
public boolean getJavaScriptEnabled()Get whether JavaScript support is enabled.- Returns:
- Whether JavaScript support is enabled.
-
setJavaScriptEnabled
Set whether JavaScript support should be enabled.- Parameters:
flag
- A flag determining whether JavaScript should be enabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getRemoteDebuggingEnabled
public boolean getRemoteDebuggingEnabled()Get whether remote debugging support is enabled.- Returns:
- True if remote debugging support is enabled.
-
setRemoteDebuggingEnabled
Set whether remote debugging support should be enabled.- Parameters:
enabled
- True if remote debugging should be enabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getWebFontsEnabled
public boolean getWebFontsEnabled()Get whether web fonts support is enabled.- Returns:
- Whether web fonts support is enabled.
-
setWebFontsEnabled
Set whether support for web fonts should be enabled.- Parameters:
flag
- A flag determining whether web fonts should be enabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getPauseForDebuggerEnabled
public boolean getPauseForDebuggerEnabled()Gets whether the pause-for-debugger is enabled or not.- Returns:
- True if the pause is enabled.
-
getForceEnableAccessibility
public boolean getForceEnableAccessibility()Gets whether accessibility is force enabled or not.- Returns:
- true if accessibility is force enabled.
-
setForceEnableAccessibility
Sets whether accessibility is force enabled or not.Useful when testing accessibility.
- Parameters:
value
- whether accessibility is force enabled or not- Returns:
- this GeckoRuntimeSettings instance.
-
getUseMaxScreenDepth
public boolean getUseMaxScreenDepth()Gets whether the compositor should use the maximum screen depth when rendering.- Returns:
- True if the maximum screen depth should be used.
-
getDisplayDensityOverride
Gets the display density override value.- Returns:
- Returns a positive number. Will return null if not set.
-
getDisplayDpiOverride
Gets the display DPI override value.- Returns:
- Returns a positive number. Will return null if not set.
-
getCrashHandler
-
getScreenSizeOverride
Gets the screen size override value.- Returns:
- Returns a Rect containing the dimensions to use for the window size. Will return null if not set.
-
getLocales
Gets the list of requested locales.- Returns:
- A list of locale codes in Gecko format ("en" or "en-US").
-
setLocales
Set the locale.- Parameters:
requestedLocales
- An ordered list of locales in Gecko format ("en-US").
-
setWebManifestEnabled
Sets whether Web Manifest processing support is enabled.- Parameters:
enabled
- A flag determining whether Web Manifest processing support is enabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getWebManifestEnabled
public boolean getWebManifestEnabled()Get whether or not Web Manifest processing support is enabled.- Returns:
- True if web manifest processing support is enabled.
-
setConsoleOutputEnabled
Set whether or not web console messages should go to logcat.Note: If enabled, Gecko performance may be negatively impacted if content makes heavy use of the console API.
- Parameters:
enabled
- A flag determining whether or not web console messages should be printed to logcat.- Returns:
- This GeckoRuntimeSettings instance.
-
getConsoleOutputEnabled
public boolean getConsoleOutputEnabled()Get whether or not web console messages are sent to logcat.- Returns:
- True if console output is enabled.
-
setAutomaticFontSizeAdjustment
Set whether or not font sizes in web content should be automatically scaled according to the device's current system font scale setting. Enabling this will prevent modification of thefont size factor
. Disabling this setting will restore the previously used value for thefont size factor
.- Parameters:
enabled
- A flag determining whether or not font sizes should be scaled automatically to match the device's system font scale.- Returns:
- This GeckoRuntimeSettings instance.
-
getAutomaticFontSizeAdjustment
public boolean getAutomaticFontSizeAdjustment()Get whether or not the font sizes for web content are automatically adjusted to match the device's system font scale setting.- Returns:
- True if font sizes are automatically adjusted.
-
setFontSizeFactor
Set a font size factor that will operate as a global text zoom. All font sizes will be multiplied by this factor.The default factor is 1.0.
Currently, any changes only take effect after a reload of the session.
This setting cannot be modified while
automatic font size adjustment
is enabled.- Parameters:
fontSizeFactor
- The factor to be used for scaling all text. Setting a value of 0 disables both this feature andfont inflation
.- Returns:
- This GeckoRuntimeSettings instance.
-
setEnterpriseRootsEnabled
-
getEnterpriseRootsEnabled
public boolean getEnterpriseRootsEnabled()Gets whether the Enteprise Roots feature is enabled or not.- Returns:
- true if the feature is enabled, false otherwise.
-
getFontSizeFactor
public float getFontSizeFactor()Gets the currently applied font size factor.- Returns:
- The currently applied font size factor.
-
setFontInflationEnabled
Set whether or not font inflation for non mobile-friendly pages should be enabled. The default value of this setting isfalse
.When enabled, font sizes will be increased on all pages that are lacking a <meta> viewport tag and have been loaded in a session using
GeckoSessionSettings.VIEWPORT_MODE_MOBILE
. To improve readability, the font inflation logic will attempt to increase font sizes for the main text content of the page only.The magnitude of font inflation applied depends on the
font size factor
currently in use.Currently, any changes only take effect after a reload of the session.
- Parameters:
enabled
- A flag determining whether or not font inflation should be enabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getFontInflationEnabled
public boolean getFontInflationEnabled()Get whether or not font inflation for non mobile-friendly pages is currently enabled.- Returns:
- True if font inflation is enabled.
-
getPreferredColorScheme
public int getPreferredColorScheme()Gets the preferred color scheme override for web content.- Returns:
- One of the
COLOR_SCHEME_*
constants.
-
setPreferredColorScheme
Sets the preferred color scheme override for web content.- Parameters:
scheme
- The preferred color scheme. Must be one of theCOLOR_SCHEME_*
constants.- Returns:
- This GeckoRuntimeSettings instance.
-
getInputAutoZoomEnabled
public boolean getInputAutoZoomEnabled()Gets whether auto-zoom to editable fields is enabled.- Returns:
- True if auto-zoom is enabled, false otherwise.
-
setInputAutoZoomEnabled
Set whether auto-zoom to editable fields should be enabled.- Parameters:
flag
- True if auto-zoom should be enabled, false otherwise.- Returns:
- This GeckoRuntimeSettings instance.
-
getDoubleTapZoomingEnabled
public boolean getDoubleTapZoomingEnabled()Gets whether double-tap zooming is enabled.- Returns:
- True if double-tap zooming is enabled, false otherwise.
-
setDoubleTapZoomingEnabled
Sets whether double tap zooming is enabled.- Parameters:
flag
- true if double tap zooming should be enabled, false otherwise.- Returns:
- This GeckoRuntimeSettings instance.
-
getGlMsaaLevel
public int getGlMsaaLevel()Gets the current WebGL MSAA level.- Returns:
- number of MSAA samples, 0 if MSAA is disabled.
-
setGlMsaaLevel
Sets the WebGL MSAA level.- Parameters:
level
- number of MSAA samples, 0 if MSAA should be disabled.- Returns:
- This GeckoRuntimeSettings instance.
-
getTelemetryDelegate
-
getAboutConfigEnabled
public boolean getAboutConfigEnabled()Gets whether about:config is enabled or not.- Returns:
- True if about:config is enabled, false otherwise.
-
setAboutConfigEnabled
Sets whether or not about:config should be enabled. This is a page that allows users to directly modify Gecko preferences. Modification of some preferences may cause the app to break in unpredictable ways -- crashes, performance issues, security vulnerabilities, etc.- Parameters:
flag
- True if about:config should be enabled, false otherwise.- Returns:
- This GeckoRuntimeSettings instance.
-
getForceUserScalableEnabled
public boolean getForceUserScalableEnabled()Gets whether or not force user scalable zooming should be enabled or not.- Returns:
- True if force user scalable zooming should be enabled, false otherwise.
-
setForceUserScalableEnabled
Sets whether or not pinch-zooming should be enabled whenuser-scalable=no
is set on the viewport.- Parameters:
flag
- True if force user scalable zooming should be enabled, false otherwise.- Returns:
- This GeckoRuntimeSettings instance.
-
getLoginAutofillEnabled
public boolean getLoginAutofillEnabled()Get whether login form autofill is enabled.- Returns:
- True if login autofill is enabled.
-
setLoginAutofillEnabled
Set whether login forms should be filled automatically if only one viable candidate is provided viaonLoginFetch
.- Parameters:
enabled
- A flag determining whether login autofill should be enabled.- Returns:
- The builder instance.
-
getAllowInsecureConnections
public int getAllowInsecureConnections()Get whether and where insecure (non-HTTPS) connections are allowed.- Returns:
- One of the
HttpsOnlyMode
constants.
-
setAllowInsecureConnections
Set whether and where insecure (non-HTTPS) connections are allowed.- Parameters:
level
- One of theHttpsOnlyMode
constants.- Returns:
- This GeckoRuntimeSettings instance.
-
writeToParcel
- Specified by:
writeToParcel
in interfaceParcelable
- Overrides:
writeToParcel
in classRuntimeSettings
-
readFromParcel
- Overrides:
readFromParcel
in classRuntimeSettings
-