Reputation: 105
I want to read the contents of a page opened with Flutter webview. Before the page opens, the user needs to manually enter the information on the previous page, and I have no chance to do this in the background with http. How can I get the data on the opened page with WebView (which can be webview_flutter or flutter_webview_plugin). Thanks in advance.
Upvotes: 1
Views: 1791
Reputation: 34252
There is nothing out of the box exactly for that purpose, however, webview_flutter
supports communicating with the page using JavascriptChannel
. Using controller.evaluateJavascript
, you can inject a script that sends the page content to the channel using postMessage
. See the examples in the plugin repo.
Upvotes: 3