WebView.setCorsAllowlist

Sets the allowlist for CORS.

Sets the allowlist for which Cross-Origin Resource Sharing

checks are disabled in web_view. URI patterns must be of the form [protocol]://[host]/[path], each component may contain the wildcard character (*) to represent zero or more other characters. All three components are required and must not be omitted from the URI patterns.

Disabling CORS checks permits resources from other origins to load allowlisted resources. It does not permit the allowlisted resources to load resources from other origins.

If this function is called multiple times, only the allowlist set by the most recent call will be effective.

class WebView
void
setCorsAllowlist
(
string[] allowlist = null
)

Parameters

allowlist string[]

an allowlist of URI patterns, or null