We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evaluateJavascript do nothing
evaluateJavascript will perform the script
evaluateJavascript doesn't work in Web platform, in other platforms it's working well
import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class HelloWidget extends StatefulWidget { const HelloWidget({super.key}); @override State<HelloWidget> createState() => _HelloWidgetState(); } class _HelloWidgetState extends State<HelloWidget> { late InAppWebViewController webViewController; final htmlHello = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <p4>Hello</p4> </body> </html> """; InAppWebViewSettings settings = InAppWebViewSettings( mediaPlaybackRequiresUserGesture: false, clearCache: true, javaScriptEnabled: true, ); @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return Container( height: 300, width: 300, color: Colors.white, child: InAppWebView( initialData: InAppWebViewInitialData(data: htmlHello), initialSettings: settings, onWebViewCreated: onWebViewCreated, onLoadStop: (controller, url) async { webViewController.evaluateJavascript(source: "alert('Loaded')"); // Do nothing instead of pop an Alert message var result = await webViewController.evaluateJavascript(source: "1 + 1"); print(result.runtimeType); // return null instead of int print(result); // return null instead of 2 result = await webViewController.evaluateJavascript(source: "new XMLSerializer().serializeToString(document);"); print(result.runtimeType); // return null instead of String print(result); // return null instead of whole web page HTML String }), ); } void onWebViewCreated(InAppWebViewController controller) { webViewController = controller; } }
No logs
v3.24.4
Chrome Version 120.0.6099.109 (Official Build) (arm64)
v6.1.5
No response
The text was updated successfully, but these errors were encountered:
As you can see in the code above, I'm using the official in_app_webview examples and it doesn't work
Sorry, something went wrong.
No branches or pull requests
Is there an existing issue for this?
Current Behavior
evaluateJavascript do nothing
Expected Behavior
evaluateJavascript will perform the script
Steps with code example to reproduce
evaluateJavascript doesn't work in Web platform, in other platforms it's working well
Steps with code example to reproduce
Stacktrace/Logs
Stacktrace/Logs
Flutter version
v3.24.4
Operating System, Device-specific and/or Tool
Chrome Version 120.0.6099.109 (Official Build) (arm64)
Plugin version
v6.1.5
Additional information
No response
Self grab
The text was updated successfully, but these errors were encountered: