@AnyThread public static final class GeckoRuntimeSettings.Builder extends RuntimeSettings.Builder<GeckoRuntimeSettings>
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
GeckoRuntimeSettings.Builder |
aboutConfigEnabled(boolean flag)
Sets whether or not about:config should be enabled.
|
GeckoRuntimeSettings.Builder |
allowInsecureConnections(int level)
Sets whether and where insecure (non-HTTPS) connections are allowed.
|
GeckoRuntimeSettings.Builder |
arguments(String[] args)
Set the custom Gecko process arguments.
|
GeckoRuntimeSettings.Builder |
automaticFontSizeAdjustment(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.Builder |
configFilePath(String configFilePath)
Path to configuration file from which GeckoView will read configuration options such as
Gecko process arguments, environment variables, and preferences.
|
GeckoRuntimeSettings.Builder |
consoleOutput(boolean enabled)
Set whether or not web console messages should go to logcat.
|
GeckoRuntimeSettings.Builder |
contentBlocking(ContentBlocking.Settings cb) |
GeckoRuntimeSettings.Builder |
crashHandler(Class<? extends Service> handler)
When set, the specified
Service will be started by
an Intent with action GeckoRuntime.ACTION_CRASHED when
a crash is encountered. |
GeckoRuntimeSettings.Builder |
debugLogging(boolean enable)
Enables GeckoView and Gecko Logging.
|
GeckoRuntimeSettings.Builder |
displayDensityOverride(float density)
Set the display density override.
|
GeckoRuntimeSettings.Builder |
displayDpiOverride(int dpi)
Set the display DPI override.
|
GeckoRuntimeSettings.Builder |
doubleTapZoomingEnabled(boolean flag)
Set whether double tap zooming should be enabled.
|
GeckoRuntimeSettings.Builder |
extras(Bundle extras)
Set the custom Gecko intent extras.
|
GeckoRuntimeSettings.Builder |
fontInflation(boolean enabled)
Set whether or not font inflation for non mobile-friendly pages should be enabled.
|
GeckoRuntimeSettings.Builder |
fontSizeFactor(float fontSizeFactor)
Set a font size factor that will operate as a global text zoom.
|
GeckoRuntimeSettings.Builder |
forceUserScalableEnabled(boolean flag)
Sets whether or not pinch-zooming should be enabled when
user-scalable=no is set on the viewport. |
GeckoRuntimeSettings.Builder |
glMsaaLevel(int level)
Sets the WebGL MSAA level.
|
GeckoRuntimeSettings.Builder |
inputAutoZoomEnabled(boolean flag)
Set whether auto-zoom to editable fields should be enabled.
|
GeckoRuntimeSettings.Builder |
javaScriptEnabled(boolean flag)
Set whether JavaScript support should be enabled.
|
GeckoRuntimeSettings.Builder |
locales(String[] requestedLocales)
Set the locale.
|
GeckoRuntimeSettings.Builder |
loginAutofillEnabled(boolean enabled)
Set whether login forms should be filled automatically if only one
viable candidate is provided via
onLoginFetch . |
protected GeckoRuntimeSettings |
newSettings(GeckoRuntimeSettings settings)
Create a default or copy settings object.
|
GeckoRuntimeSettings.Builder |
pauseForDebugger(boolean enabled)
Set whether there should be a pause during startup.
|
GeckoRuntimeSettings.Builder |
preferredColorScheme(int scheme)
Sets the preferred color scheme override for web content.
|
GeckoRuntimeSettings.Builder |
remoteDebuggingEnabled(boolean enabled)
Set whether remote debugging support should be enabled.
|
GeckoRuntimeSettings.Builder |
screenSizeOverride(int width,
int height)
Set the screen size override.
|
GeckoRuntimeSettings.Builder |
telemetryDelegate(RuntimeTelemetry.Delegate delegate)
Add a
RuntimeTelemetry.Delegate instance to this
GeckoRuntime. |
GeckoRuntimeSettings.Builder |
useMaxScreenDepth(boolean enable)
Set whether the to report the full bit depth of the device.
|
GeckoRuntimeSettings.Builder |
webFontsEnabled(boolean flag)
Set whether support for web fonts should be enabled.
|
GeckoRuntimeSettings.Builder |
webManifest(boolean enabled)
Set whether web manifest support is enabled.
|
build, getSettings
@NonNull protected GeckoRuntimeSettings newSettings(@Nullable GeckoRuntimeSettings settings)
RuntimeSettings.Builder
newSettings
in class RuntimeSettings.Builder<GeckoRuntimeSettings>
settings
- Settings object to copy, null for default settings.@NonNull public GeckoRuntimeSettings.Builder arguments(@NonNull String[] args)
args
- The Gecko process arguments.@NonNull public GeckoRuntimeSettings.Builder extras(@NonNull Bundle extras)
extras
- The Gecko intent extras.@NonNull public GeckoRuntimeSettings.Builder configFilePath(@Nullable String configFilePath)
Build.VERSION.SDK_INT
> 21
, on older devices this will be
silently ignored.configFilePath
- Configuration file path to read from, or null
to use
default location /data/local/tmp/$PACKAGE-geckoview-config.yaml
.@NonNull public GeckoRuntimeSettings.Builder javaScriptEnabled(boolean flag)
flag
- A flag determining whether JavaScript should be enabled.
Default is true.@NonNull public GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean enabled)
enabled
- True if remote debugging should be enabled.@NonNull public GeckoRuntimeSettings.Builder webFontsEnabled(boolean flag)
flag
- A flag determining whether web fonts should be enabled.
Default is true.@NonNull public GeckoRuntimeSettings.Builder pauseForDebugger(boolean enabled)
enabled
- A flag determining whether there will be a pause early in startup.
Defaults to false.@NonNull public GeckoRuntimeSettings.Builder useMaxScreenDepth(boolean enable)
enable
- A flag determining whether maximum screen depth should be used.@NonNull public GeckoRuntimeSettings.Builder webManifest(boolean enabled)
enabled
- A flag determining whether Web Manifest processing support is
enabled.@NonNull public GeckoRuntimeSettings.Builder consoleOutput(boolean enabled)
enabled
- A flag determining whether or not web console messages should be
printed to logcat.@NonNull public GeckoRuntimeSettings.Builder automaticFontSizeAdjustment(boolean enabled)
enabled
- A flag determining whether or not font sizes should be scaled automatically
to match the device's system font scale.@NonNull public GeckoRuntimeSettings.Builder fontSizeFactor(float fontSizeFactor)
The default factor is 1.0.
This setting cannot be modified if
automatic font size adjustment
has already been enabled.
fontSizeFactor
- The factor to be used for scaling all text. Setting a value of 0
disables both this feature and
font inflation
.@NonNull public GeckoRuntimeSettings.Builder fontInflation(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.
This setting cannot be modified if
automatic font size adjustment
has already been enabled.
enabled
- A flag determining whether or not font inflation should be enabled.@NonNull public GeckoRuntimeSettings.Builder displayDensityOverride(float density)
density
- The display density value to use for overriding the system default.@NonNull public GeckoRuntimeSettings.Builder displayDpiOverride(int dpi)
dpi
- The display DPI value to use for overriding the system default.@NonNull public GeckoRuntimeSettings.Builder screenSizeOverride(int width, int height)
width
- The screen width value to use for overriding the system default.height
- The screen height value to use for overriding the system default.@NonNull public GeckoRuntimeSettings.Builder loginAutofillEnabled(boolean enabled)
onLoginFetch
.enabled
- A flag determining whether login autofill should be
enabled.@NonNull public GeckoRuntimeSettings.Builder crashHandler(@Nullable Class<? extends Service> handler)
Service
will be started by
an Intent
with action GeckoRuntime.ACTION_CRASHED
when
a crash is encountered. Crash details can be found in the Intent extras, such as
GeckoRuntime.EXTRA_MINIDUMP_PATH
.
GeckoRuntime
. Additionally, the handler will be run as a foreground service,
so the normal rules about activating a foreground service apply.
Service.startForeground(int, android.app.Notification)
. You can then
take as much time as necessary to report the crash.Service.startForeground(int, android.app.Notification)
this should be in a different process from the crash handler, since Android will
kill the crash handler process as part of the background execution limitations.JobScheduler
. This will allow you to
do substantial work in the background without execution limits.CrashReporter
to send the report to Mozilla, which provides Mozilla
with data needed to fix the crash. Be aware that the minidump may contain
personally identifiable information (PII). Consult Mozilla's
privacy policy for information
on how this data will be handled.handler
- The class for the crash handler Service.GeckoRuntime.ACTION_CRASHED
@NonNull public GeckoRuntimeSettings.Builder locales(@Nullable String[] requestedLocales)
requestedLocales
- List of locale codes in Gecko format ("en" or "en-US").@NonNull public GeckoRuntimeSettings.Builder contentBlocking(@NonNull ContentBlocking.Settings cb)
@NonNull public GeckoRuntimeSettings.Builder preferredColorScheme(int scheme)
scheme
- The preferred color scheme. Must be one of the
COLOR_SCHEME_*
constants.@NonNull public GeckoRuntimeSettings.Builder inputAutoZoomEnabled(boolean flag)
flag
- True if auto-zoom should be enabled, false otherwise.@NonNull public GeckoRuntimeSettings.Builder doubleTapZoomingEnabled(boolean flag)
flag
- True if double tap zooming should be enabled, false otherwise.@NonNull public GeckoRuntimeSettings.Builder glMsaaLevel(int level)
level
- number of MSAA samples, 0 if MSAA should be disabled.@NonNull public GeckoRuntimeSettings.Builder telemetryDelegate(@NonNull RuntimeTelemetry.Delegate delegate)
RuntimeTelemetry.Delegate
instance to this
GeckoRuntime. This delegate can be used by the app to receive
streaming telemetry data from GeckoView.delegate
- the delegate that will handle telemetry@NonNull public GeckoRuntimeSettings.Builder debugLogging(boolean enable)
enable
- True if logging is enabled.@NonNull public GeckoRuntimeSettings.Builder aboutConfigEnabled(boolean flag)
flag
- True if about:config should be enabled, false otherwise.@NonNull public GeckoRuntimeSettings.Builder forceUserScalableEnabled(boolean flag)
user-scalable=no
is set on the viewport.flag
- True if force user scalable zooming should be enabled, false otherwise.@NonNull public GeckoRuntimeSettings.Builder allowInsecureConnections(int level)
level
- One of the HttpsOnlyMode
constants.