removeJavaScriptHandler method

Function? removeJavaScriptHandler({
  1. required String handlerName,
})

Removes a JavaScript message handler previously added with the addJavaScriptHandler associated to handlerName key. Returns the value associated with handlerName before it was removed. Returns null if handlerName was not found.

Officially Supported Platforms/Implementations:

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

Parameters - Officially Supported Platforms/Implementations:

  • handlerName: all platforms

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

Implementation

Function? removeJavaScriptHandler({required String handlerName}) =>
    platform.removeJavaScriptHandler(handlerName: handlerName);