RestrictionAllowlist.Builder


class RestrictionAllowlist.Builder


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

Summary

Public constructors

Builder(originPatterns: (Mutable)Set<String>)

Construct a RestrictionAllowlist Builder

Public functions

RestrictionAllowlist.Builder
addJavaScriptInterface(object: Any, name: String)

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

RestrictionAllowlist

Constructs a new RestrictionAllowlist that can be attached via setRestrictionAllowlist.

Public constructors

Builder

Added in 1.15.0-beta01
Builder(originPatterns: (Mutable)Set<String>)

Construct a RestrictionAllowlist Builder

See addWebMessageListener for the rules of the originPatterns parameter.

Parameters
originPatterns: (Mutable)Set<String>

List of origin patterns to allow the selected behaviors on.

Public functions

addJavaScriptInterface

Added in 1.15.0-beta01
fun addJavaScriptInterface(object: Any, name: String): RestrictionAllowlist.Builder

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
fun build(): RestrictionAllowlist

Constructs a new RestrictionAllowlist that can be attached via setRestrictionAllowlist.

See also
WebViewBuilder