ProcessGlobalConfig class
Process Global Configuration for WebView
.
WebView has some process-global configuration parameters
that cannot be changed once WebView has been loaded.
This class allows apps to set these parameters.
If it is used, the configuration should be set and apply should
be called prior to loading WebView into the calling process.
Most of the methods in android.webkit
and androidx.webkit
packages load WebView,
so the configuration should be applied before calling any of these methods.
The following code configures the data directory suffix that WebView uses and then applies the configuration. WebView uses this configuration when it is loaded.
apply can only be called once.
Only a single thread should access this class at a given time.
The configuration should be set up as early as possible during application startup,
to ensure that it happens before any other thread can call a method that loads WebView
.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - ProcessGlobalConfig)
Constructors
- ProcessGlobalConfig()
-
Process Global Configuration for
WebView
. WebView has some process-global configuration parameters that cannot be changed once WebView has been loaded. This class allows apps to set these parameters. - ProcessGlobalConfig.fromPlatform(PlatformProcessGlobalConfig platform)
- Constructs a ProcessGlobalConfig from a specific platform implementation.
- ProcessGlobalConfig.fromPlatformCreationParams(PlatformProcessGlobalConfigCreationParams params)
- Constructs a ProcessGlobalConfig from creation params for a specific platform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- platform → PlatformProcessGlobalConfig
-
Implementation of PlatformProcessGlobalConfig for the current platform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
apply(
{required ProcessGlobalConfigSettings settings}) → Future< void> -
Applies the configuration to be used by
WebView
on loading. This method can only be called once. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
instance(
) → ProcessGlobalConfig - Gets the ProcessGlobalConfig shared instance.