RestrictionAllowlist.Builder


public final class RestrictionAllowlist.Builder


RestrictionAllowlist builder. Add the RestrictionAllowlist produced to a WebView via addAllowlist.

Summary

Public constructors

Builder(@NonNull Set<@NonNull String> originPatterns)

Construct a RestrictionAllowlist Builder

Public methods

@NonNull RestrictionAllowlist.Builder

This API is the same as addJavascriptInterface except it will only inject the interface into the origin patterns allowed.

@NonNull RestrictionAllowlist

Constructs a new RestrictionAllowlist that can be attached via setRestrictionAllowlist.

Public constructors

Builder

Added in 1.15.0-beta01
public Builder(@NonNull Set<@NonNull String> originPatterns)

Construct a RestrictionAllowlist Builder

See addWebMessageListener for the rules of the originPatterns parameter.

Parameters
@NonNull Set<@NonNull String> originPatterns

List of origin patterns to allow the selected behaviors on.

Public methods

addJavaScriptInterface

Added in 1.15.0-beta01
public @NonNull RestrictionAllowlist.Builder addJavaScriptInterface(@NonNull Object object, @NonNull String name)

This API is the same as addJavascriptInterface except it will only inject the interface into the origin patterns allowed.

A name value may only be used once per WebViewBuilder, regardless of whether it's the same, a different, or an equivalent allowlist.

build

Added in 1.15.0-beta01
public @NonNull RestrictionAllowlist build()

Constructs a new RestrictionAllowlist that can be attached via setRestrictionAllowlist.

See also
WebViewBuilder