addJavascriptChannels method

  1. @override
Future<void> addJavascriptChannels(
  1. Set<String> javascriptChannelNames
)
override

Adds new JavaScript channels to the set of enabled channels.

For each value in this list the platform's webview should make sure that a corresponding property with a postMessage method is set on window. For example for a JavaScript channel named Foo it should be possible for JavaScript code executing in the webview to do

Foo.postMessage('hello');

See also: CreationParams.javascriptChannelNames.

Implementation

@override
Future<void> addJavascriptChannels(Set<String> javascriptChannelNames) {
  return _channel.invokeMethod<void>(
      'addJavascriptChannels', javascriptChannelNames.toList());
}