@AnyThread public final class GeckoRuntimeSettings extends RuntimeSettings
Modifier and Type | Class and Description |
---|---|
static class |
GeckoRuntimeSettings.Builder
Settings builder used to construct the settings object.
|
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_ALL
Allow all insecure connections
|
static int |
COLOR_SCHEME_DARK
A dark theme for web content is preferred.
|
static int |
COLOR_SCHEME_LIGHT
A light theme for web content is preferred.
|
static int |
COLOR_SCHEME_SYSTEM
The preferred color scheme will be based on system settings.
|
static Parcelable.Creator<GeckoRuntimeSettings> |
CREATOR |
static int |
HTTPS_ONLY
Only allow HTTPS connections.
|
static int |
HTTPS_ONLY_PRIVATE
Allow insecure connections in normal browsing, but only HTTPS in private browsing.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
boolean |
getAboutConfigEnabled()
Gets whether about:config is enabled or not.
|
int |
getAllowInsecureConnections()
Get whether and where insecure (non-HTTPS) connections are allowed.
|
String[] |
getArguments()
Get the custom Gecko process arguments.
|
boolean |
getAutomaticFontSizeAdjustment()
Get whether or not the font sizes for web content are automatically adjusted to match the
device's system font scale setting.
|
String |
getConfigFilePath()
Path to configuration file from which GeckoView will read configuration options such as
Gecko process arguments, environment variables, and preferences.
|
boolean |
getConsoleOutputEnabled()
Get whether or not web console messages are sent to logcat.
|
ContentBlocking.Settings |
getContentBlocking() |
Class<? extends Service> |
getCrashHandler() |
Float |
getDisplayDensityOverride()
Gets the display density override value.
|
Integer |
getDisplayDpiOverride()
Gets the display DPI override value.
|
boolean |
getDoubleTapZoomingEnabled()
Gets whether double-tap zooming is enabled.
|
Bundle |
getExtras()
Get the custom Gecko intent extras.
|
boolean |
getFontInflationEnabled()
Get whether or not font inflation for non mobile-friendly pages is currently enabled.
|
float |
getFontSizeFactor()
Gets the currently applied font size factor.
|
boolean |
getForceUserScalableEnabled()
Gets whether or not force user scalable zooming should be enabled or not.
|
int |
getGlMsaaLevel()
Gets the current WebGL MSAA level.
|
boolean |
getInputAutoZoomEnabled()
Gets whether auto-zoom to editable fields is enabled.
|
boolean |
getJavaScriptEnabled()
Get whether JavaScript support is enabled.
|
String[] |
getLocales()
Gets the list of requested locales.
|
boolean |
getLoginAutofillEnabled()
Get whether login form autofill is enabled.
|
boolean |
getPauseForDebuggerEnabled()
Gets whether the pause-for-debugger is enabled or not.
|
int |
getPreferredColorScheme()
Gets the preferred color scheme override for web content.
|
boolean |
getRemoteDebuggingEnabled()
Get whether remote debugging support is enabled.
|
GeckoRuntime |
getRuntime() |
Rect |
getScreenSizeOverride()
Gets the screen size override value.
|
RuntimeTelemetry.Delegate |
getTelemetryDelegate() |
boolean |
getUseMaxScreenDepth()
Gets whether the compositor should use the maximum screen depth when rendering.
|
boolean |
getWebFontsEnabled()
Get whether web fonts support is enabled.
|
boolean |
getWebManifestEnabled()
Get whether or not Web Manifest processing support is enabled.
|
void |
readFromParcel(Parcel source) |
GeckoRuntimeSettings |
setAboutConfigEnabled(boolean flag)
Sets whether or not about:config should be enabled.
|
GeckoRuntimeSettings |
setAllowInsecureConnections(int level)
Set whether and where insecure (non-HTTPS) connections are allowed.
|
GeckoRuntimeSettings |
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.
|
GeckoRuntimeSettings |
setConsoleOutputEnabled(boolean enabled)
Set whether or not web console messages should go to logcat.
|
GeckoRuntimeSettings |
setDoubleTapZoomingEnabled(boolean flag)
Sets whether double tap zooming is enabled.
|
GeckoRuntimeSettings |
setFontInflationEnabled(boolean enabled)
Set whether or not font inflation for non mobile-friendly pages should be enabled.
|
GeckoRuntimeSettings |
setFontSizeFactor(float fontSizeFactor)
Set a font size factor that will operate as a global text zoom.
|
GeckoRuntimeSettings |
setForceUserScalableEnabled(boolean flag)
Sets whether or not pinch-zooming should be enabled when
user-scalable=no is set on the viewport. |
GeckoRuntimeSettings |
setGlMsaaLevel(int level)
Sets the WebGL MSAA level.
|
GeckoRuntimeSettings |
setInputAutoZoomEnabled(boolean flag)
Set whether auto-zoom to editable fields should be enabled.
|
GeckoRuntimeSettings |
setJavaScriptEnabled(boolean flag)
Set whether JavaScript support should be enabled.
|
void |
setLocales(String[] requestedLocales)
Set the locale.
|
GeckoRuntimeSettings |
setLoginAutofillEnabled(boolean enabled)
Set whether login forms should be filled automatically if only one
viable candidate is provided via
onLoginFetch . |
GeckoRuntimeSettings |
setPreferredColorScheme(int scheme)
Sets the preferred color scheme override for web content.
|
GeckoRuntimeSettings |
setRemoteDebuggingEnabled(boolean enabled)
Set whether remote debugging support should be enabled.
|
GeckoRuntimeSettings |
setWebFontsEnabled(boolean flag)
Set whether support for web fonts should be enabled.
|
GeckoRuntimeSettings |
setWebManifestEnabled(boolean enabled)
Sets whether Web Manifest processing support is enabled.
|
void |
writeToParcel(Parcel out,
int flags) |
describeContents, updatePrefs
public static final int COLOR_SCHEME_LIGHT
public static final int COLOR_SCHEME_DARK
public static final int COLOR_SCHEME_SYSTEM
public static final int ALLOW_ALL
public static final int HTTPS_ONLY_PRIVATE
public static final int HTTPS_ONLY
public static final Parcelable.Creator<GeckoRuntimeSettings> CREATOR
@NonNull public ContentBlocking.Settings getContentBlocking()
@Nullable public GeckoRuntime getRuntime()
@NonNull public String[] getArguments()
@NonNull public Bundle getExtras()
@Nullable public String getConfigFilePath()
Build.VERSION.SDK_INT
> 21
.null
for default location
/data/local/tmp/$PACKAGE-geckoview-config.yaml
.public boolean getJavaScriptEnabled()
@NonNull public GeckoRuntimeSettings setJavaScriptEnabled(boolean flag)
flag
- A flag determining whether JavaScript should be enabled.public boolean getRemoteDebuggingEnabled()
@NonNull public GeckoRuntimeSettings setRemoteDebuggingEnabled(boolean enabled)
enabled
- True if remote debugging should be enabled.public boolean getWebFontsEnabled()
@NonNull public GeckoRuntimeSettings setWebFontsEnabled(boolean flag)
flag
- A flag determining whether web fonts should be enabled.public boolean getPauseForDebuggerEnabled()
public boolean getUseMaxScreenDepth()
@Nullable public Float getDisplayDensityOverride()
@Nullable public Integer getDisplayDpiOverride()
@Nullable public Rect getScreenSizeOverride()
@Nullable public String[] getLocales()
public void setLocales(@Nullable String[] requestedLocales)
requestedLocales
- An ordered list of locales in Gecko format ("en-US").@NonNull public GeckoRuntimeSettings setWebManifestEnabled(boolean enabled)
enabled
- A flag determining whether Web Manifest processing support is
enabled.public boolean getWebManifestEnabled()
@NonNull public GeckoRuntimeSettings setConsoleOutputEnabled(boolean enabled)
enabled
- A flag determining whether or not web console messages should be
printed to logcat.public boolean getConsoleOutputEnabled()
@NonNull public GeckoRuntimeSettings setAutomaticFontSizeAdjustment(boolean enabled)
font size factor
.
Disabling this setting will restore the previously used value for the
font size factor
.enabled
- A flag determining whether or not font sizes should be scaled automatically
to match the device's system font scale.public boolean getAutomaticFontSizeAdjustment()
@NonNull public GeckoRuntimeSettings setFontSizeFactor(float fontSizeFactor)
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.
fontSizeFactor
- The factor to be used for scaling all text. Setting a value of 0
disables both this feature and
font inflation
.public float getFontSizeFactor()
@NonNull public GeckoRuntimeSettings setFontInflationEnabled(boolean enabled)
false
.
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.
enabled
- A flag determining whether or not font inflation should be enabled.public boolean getFontInflationEnabled()
public int getPreferredColorScheme()
COLOR_SCHEME_*
constants.@NonNull public GeckoRuntimeSettings setPreferredColorScheme(int scheme)
scheme
- The preferred color scheme. Must be one of the
COLOR_SCHEME_*
constants.public boolean getInputAutoZoomEnabled()
@NonNull public GeckoRuntimeSettings setInputAutoZoomEnabled(boolean flag)
flag
- True if auto-zoom should be enabled, false otherwise.public boolean getDoubleTapZoomingEnabled()
@NonNull public GeckoRuntimeSettings setDoubleTapZoomingEnabled(boolean flag)
flag
- true if double tap zooming should be enabled, false otherwise.public int getGlMsaaLevel()
@NonNull public GeckoRuntimeSettings setGlMsaaLevel(int level)
level
- number of MSAA samples, 0 if MSAA should be disabled.@Nullable public RuntimeTelemetry.Delegate getTelemetryDelegate()
public boolean getAboutConfigEnabled()
@NonNull public GeckoRuntimeSettings setAboutConfigEnabled(boolean flag)
flag
- True if about:config should be enabled, false otherwise.public boolean getForceUserScalableEnabled()
@NonNull public GeckoRuntimeSettings setForceUserScalableEnabled(boolean flag)
user-scalable=no
is set on the viewport.flag
- True if force user scalable zooming should be enabled, false otherwise.public boolean getLoginAutofillEnabled()
@NonNull public GeckoRuntimeSettings setLoginAutofillEnabled(boolean enabled)
onLoginFetch
.enabled
- A flag determining whether login autofill should be
enabled.public int getAllowInsecureConnections()
HttpsOnlyMode
constants.@NonNull public GeckoRuntimeSettings setAllowInsecureConnections(int level)
level
- One of the HttpsOnlyMode
constants.public void writeToParcel(Parcel out, int flags)
writeToParcel
in interface Parcelable
writeToParcel
in class RuntimeSettings
public void readFromParcel(@NonNull Parcel source)
readFromParcel
in class RuntimeSettings