#how to inject javascript in pages?

5 messages · Page 1 of 1 (latest)

fringe horizon
#

I am loading an url in my tauri app and I need to execute some javascript.
How can I be notified when the url changes and load my javscript as required.
I was able to accomplish this with electron but unable to with tauri. I know some javascript but I don't know rust at all.. I am trying though.
I already searched on google, github, chatgpt etc. I understood it is possible but unable to figure out how.. I learnt that webview.eval might help but facing great difficulty.

drifting plaza
#

uhh what?

#

what are you actually trying to accomplish? are you loading third-party websites in a new webview window? or are you just trying to listen for route changes in your own application?

fringe horizon
#

Thank you for your response, I am loading a website.. see following config
"windows": [
{
"url": "https://www.google.com",
}
so, I will get the google homepage.
Now, I need to execute some javascript on the page after the page is loaded, and everytime the url changes..