Closed agtokty closed 4 years ago
OK, I found the solution when inspecting source code. I set the hidden to true
...
final flutterWebViewPlugin = FlutterWebviewPlugin();
@override
void initState() {
super.initState();
flutterWebViewPlugin.close();
flutterWebViewPlugin.launch('someurl', hidden: true);
...
# after flutterWebViewPlugin loads
String result = await flutterWebViewPlugin.evalJavascript('function fun(data){ return data;} fun(123) '); # returns 123
...
}
Hi, I need to evaulate simple javascript codes than get the return result from it. But it seems like that I couldn't do it without page loading.
But its ok, I can wait the page load finish using a dummy web site, but this should be in background. not fill my entire screen with that web site content. Is there any way to run javascript code in background ?