addUserScripts method

Future<void> addUserScripts({
  1. required List<UserScript> userScripts,
})

Injects the userScripts into the webpage’s content.

NOTE for iOS and MacOS: this method will throw an error if the PlatformWebViewCreationParams.windowId has been set. There isn't any way to add/remove user scripts specific to window WebViews. This is a limitation of the native WebKit APIs.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • MacOS

Implementation

Future<void> addUserScripts({required List<UserScript> userScripts}) =>
    platform.addUserScripts(userScripts: userScripts);