hasUserScript method

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

bool hasUserScript({required UserScript userScript}) =>
    platform.hasUserScript(userScript: userScript);