I need create an application on Delphi XE6 for Android and iOS. This application mest be use a TWebBrowser to show Google Maps, then I need \"send\" from Delphi to javascrip
The proper way to do it is with the addJavascriptInterface function of the Android WebView, as can be seen here, here and here.
The Firemonkey TWebBrowser does not expose this function by default.
There is a custom WebView wrapper control in DPF Android as can be seen here.
You could modify that control to add the addJavascriptInterface function.
For TWebBrowser on IOS you could use the custom web browser controls in sourceforge and here.
Another possible way to do this is with the OnShouldStartLoadWithRequest event of TWebBrowser. You could do something like:
or
And see if the URL property of OnShouldStartLoadWithRequest contains #param1¶m2¶m3¶m4 or javascript:thisisatest();.
Basically the idea is to navigate to a URL that doesn't change the URL of the existing page and pick up that URL in the OnShouldStartLoadWithRequest event.