I am not good with Javascript but we have a script running on our site that after 360 sec idle the page redirects to /. However, I want to add to the script to not redirect if idle at all for two different pages. Can anyone help me add to this script so that it does not redirect if idle on specific pages?
Im sure someone has a much smarter solution than me, but you could add something that checks if a variable exists.
So wrap your global code inside the “if statement” and on the pages where you don’t want the redirect to happen you set this variable to true, in this case the “notAllowedToRedirect” variable.
This variables has to be set inside the head (and not before the </body) so the variable is set before the function call in the global custom code.