I am creating a react native application in which user can load any website in the webview. I need to pass the text of the webpage to an API paragraph by paragraph and highlight the content returned by the API.

I am unable to figure out how we can update the javascript periodically in the webview since the injected javascript runs only once and how I can run javascript functions on receiving a response from API periodically and most importantly maintain the tags already read.

Most of the examples I have seen just highlight the content by using inject javascript prop. But that runs only once. My problem is that I need to do this periodically and clear the previous highlights as well and I don't know the class of the paragraph to highlight as well since it would be a dynamic website selected by the user.

0

There are 0 best solutions below