addInitScript

suspend fun addInitScript(script: String, allowedOrigins: Set<String>)

Installs a script that runs before any page script runs on current and future documents.

Throws

ErrorCode.UNSUPPORTED if the device's WebView package lacks the WebViewFeature.DOCUMENT_START_SCRIPT feature.