removeAllUserScripts method

  1. @override
Future<void> removeAllUserScripts()

Removes all the user scripts from the webpage’s content.

Officially Supported Platforms/Implementations:

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

Implementation

@override
Future<void> removeAllUserScripts() async {
  assert(webviewParams?.windowId == null);

  _userScripts[UserScriptInjectionTime.AT_DOCUMENT_START]?.clear();
  _userScripts[UserScriptInjectionTime.AT_DOCUMENT_END]?.clear();

  Map<String, dynamic> args = <String, dynamic>{};
  await channel?.invokeMethod('removeAllUserScripts', args);
}