Page 1 of 1

wrong client-side redirect link generated by NoScript

Posted: Mon Oct 12, 2009 11:36 pm
by swyang
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.

Re: wrong client-side redirect link generated by NoScript

Posted: Tue Oct 13, 2009 8:57 am
by Giorgio Maone
swyang wrote:I think Noscript plug-in does the static code anaylsis and just concatenate static strings.
If a page where scripts are disabled has no visible link, NoScript searches for any text in script contexts suggesting navigation and shows a link.
This is helpful for users most of the time, especially on dummy front pages which are plain blank when not whitelisted.
swyang wrote:If the script script shouldn't run, the redirect URL shouldn't show at all.
I strongly disagree. This is an useful feature, as stated above, and the fact it can't work correctly in some situations is not a good reason to remove it.

Re: wrong client-side redirect link generated by NoScript

Posted: Fri Oct 16, 2009 8:24 pm
by GµårÐïåñ
Wouldn't disabling "Attempt to fix JavaScript links" resolve this issue?