Does anyone know how (if possible) to execute JS "inside" a WebView in React Native?
Scenario: I have this remote login page (website) displayed in my WebView, and this website has a sequence of events that occur according to the user's actions. All events fire one callback each, which WebView should listen to (no problem).
Inside each callback there is a link to a JavaScript function that must be called inside the WebView (what a problem!).
Therefore, from my React Native application, I need to call this JavaScript function, located on the website page (source), loaded into my WebView.
What I have: I listen to callbacks with onShouldStartLoadWithRequest and manipulate the behavior of the WebView using this and it is excellent. Regarding JavaScript execution, I tried the getWebViewHandle method, but at least I didnโt do it from my place.
I also looked at the injectedJavaScript property, but the problem is that I donโt know which JavaScript to execute before the callbacks are executed.
Does anyone know how to solve this?
source share