wrong client-side redirect link generated by NoScript
Posted: Mon Oct 12, 2009 11:36 pm
In our case, we need to redirect the url from the client side (since the url has hash part). So we generated the javascript on the page.
In firefox, if no script plug-in is enabled, it generates the wrong redirect url and show. To show the case, I created the following simplifed html.
<html>
<head><script>
<!--
var hstName = window.location.hostname; var str = window.location.href.replace(hstName,"www.google.com")
//-->
</script></head>
<body>
<h1>Please wait...You will be redirected in a few seconds.</h1>
<script>
<!--
window.location.href=str;
//-->
</script>
</body>
</html>
Put this file on the webserver, and when we open this html with firefox with noscript, it generates the following redirect URL at the bottom.
http://localhost/www.google.com
which is not correct. I think Noscript plug-in does the static code anaylsis and just concatenate static strings.
if the script script shouldn't run, the redirect URL shouldn't show at all.
In firefox, if no script plug-in is enabled, it generates the wrong redirect url and show. To show the case, I created the following simplifed html.
<html>
<head><script>
<!--
var hstName = window.location.hostname; var str = window.location.href.replace(hstName,"www.google.com")
//-->
</script></head>
<body>
<h1>Please wait...You will be redirected in a few seconds.</h1>
<script>
<!--
window.location.href=str;
//-->
</script>
</body>
</html>
Put this file on the webserver, and when we open this html with firefox with noscript, it generates the following redirect URL at the bottom.
http://localhost/www.google.com
which is not correct. I think Noscript plug-in does the static code anaylsis and just concatenate static strings.
if the script script shouldn't run, the redirect URL shouldn't show at all.