me again ... Is it possible to run javascript automatically in flutter_webview_plugin?.
I Try this by tapping an IconButton
flutterWebviewPlugin.evalJavascript('document.addEventListener("DOMContentLoaded", function(event){console.log("DOM fully loaded and parsed");})');
it doesn't works.
Actually my goal is to fill two textfields (name and password) and to submit it when the document is loaded.
If I try
flutterWebviewPlugin.evalJavascript('document.getElementById("user-id").value = "Phil Osoph"; document.getElementById("pw-id").value = "Baum123"; document._CustomLoginForm.submit(); ');
it works but if I try
flutterWebviewPlugin.evalJavascript('document.addEventListener("DOMContentLoaded", function(event){document.getElementById("user-id").value = "Phil Osoph"; document.getElementById("pw-id").value = "Baum123"; document._CustomLoginForm.submit();})');
nothing happens.
DOMContentLoadedalready happened when the JavaScript is evaluated.DOMContentLoadeddo it automatically.DOMContentLoadedis great, but it happens only once and if it already happended when you callevalJavascript()the listener will wait forever.