I have a startup script which I want it to run every 5 min. However, whenever I leave the page (close browser or directly closing the page) and navigating to another page (pervious page is not open anymore) the script is still present in the 'Running Scripts' section. Every time I go back to the page another script is added on the section and now multiple scripts are running.
I am so far using custom property and combining a for loop with time.sleep() to navigate to another page and back. This will close the script after the for loop ends but a constant refresh every 5 min wouldn't be ideal.
Is there a way, I can set it so that my script runs every 5 min as long as the user is on the page and will stops when the user leaves the page.
Add a custom property to your view.
Make it an expression binding with this expression: now(300000)
Put your script in the value change script of that property.