To handle JS redirects.