Following javascript redirects when html is too small