What is the best method and general solution to get input fields username and password pre-set from inside an application for an loaded Website inside Delphi TWebBrowser FMX?
For example:
Var iuser,ipassword: String;
…
WebBrowser.URL := www.facebook.com;
WebBrowser.Navigate;
WebBrowser.EvaluateJavaScript( ‘<script>’ +
‘var e = document.getElementById(“email”);’ +
‘e.value = “‘ +iuser+'”;}’ +
‘var s = document.getElementById(“pass”);’ +
‘s.value = “‘ +ipassword+'”;}’ +
‘</script>’
);
The above way seems not to work (fields are empty and after calling code a second time causing error) and this way is even not general, because the ID for username and password will be different on most websites.