wrong client-side redirect link generated by NoScript

Bug reports and enhancement requests
Post Reply
swyang
Posts: 1
Joined: Fri Oct 09, 2009 10:37 pm

wrong client-side redirect link generated by NoScript

Post 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.
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; MS-RTC LM 8)
User avatar
Giorgio Maone
Site Admin
Posts: 9526
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: wrong client-side redirect link generated by NoScript

Post 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.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
User avatar
GµårÐïåñ
Lieutenant Colonel
Posts: 3370
Joined: Fri Mar 20, 2009 5:19 am
Location: PST - USA
Contact:

Re: wrong client-side redirect link generated by NoScript

Post by GµårÐïåñ »

Wouldn't disabling "Attempt to fix JavaScript links" resolve this issue?
~.:[ Lï£ê ï§ å Lêmðñ åñÐ Ì Wåñ† M¥ Mðñê¥ ßå¢k ]:.~
________________ .: [ Major Mike's ] :. ________________
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Post Reply