hasUserScript method

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(), IOSPlatform(), MacOSPlatform(), WebPlatform(), WindowsPlatform()])
bool hasUserScript({
  1. required UserScript userScript,
})

Returns true if the userScript has been already added, otherwise false.

Officially Supported Platforms/Implementations:

  • Android WebView
  • iOS WKWebView
  • macOS WKWebView
  • Web <iframe> but requires same origin
  • Windows WebView2

Parameters - Officially Supported Platforms/Implementations:

  • userScript: all platforms

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(),
    IOSPlatform(),
    MacOSPlatform(),
    WebPlatform(),
    WindowsPlatform(),
  ],
)
bool hasUserScript({required UserScript userScript}) {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.hasUserScript.name} is not implemented on the current platform',
  );
}