Page 1 of 1

Attempt to fix JavaScript links: not working on relative URL

Posted: Wed Jan 20, 2016 6:34 pm
by NoThing
Hello,

I'm using NoScript 2.9.0.2 in Firefox 38.5.2ESR
I've cheked the option : in 'Advanced' > 'Untrusted' > 'Attempt to fix JavaScript links'

It does not work on this page : http://www.science20.com/ (the 4 blue text boxes, right to the main image labeled 'All featured articles')
Remark : this site is not trusted, nor marked as untrusted, in my configuration

The source of the first item gives :
<div id=\"feat-main-title\" onclick=\"javascript:window.location.href='advertising_science/blog/fda_seizes_supplements_containing_psychoactive_plant-163128';\">FDA Seizes Supplements Containing...</div>
Which should open when clicked :
http://www.science20.com/advertising_sc ... ant-163128

I thought this kind of simple link to a sub-page used to work in the past...
Is this a bug/limitation of recent versions NoScript, or is this javascript link formatted in an unusual/abnormal way ?

Edit : tried to correct the subject to : 'Attempt to fix JavaScript links: not working on relative URL'

Re: 'Attempt to fix JavaScript links' not working for a sub-

Posted: Wed Jan 20, 2016 11:56 pm
by Thrawn
It seems strange that it's setting a href property of window.location...
And I'm not sure whether the fact that it's a relative URL presents a problem.

Re: 'Attempt to fix JavaScript links' not working for a sub-

Posted: Thu Jan 21, 2016 5:02 am
by NoThing
Thanks, I don't know much about javascript.

However an discussion about window.location.href links, with relative URL, which seems 'standard' :
http://stackoverflow.com/questions/1655 ... javascript

(I wanted to have someone else try to use these links on http://www.science20.com/ with the scripts not allowed,
because I have many other Add-Ons in Firefox that could have interferred with NoScript)

Re: Attempt to fix JavaScript links: not working on relative

Posted: Thu Jan 21, 2016 1:31 pm
by barbaz
I went to another script-blocked page and changed this <a> element

Code: Select all

<a href="faq.html">test</a>
to this:

Code: Select all

<div onclick="window.location.href='faq.html'">test</div>
When I click on it, it gets change to this:

Code: Select all

<div onclick="window.location.href='faq.html'" href="faq.html" title="window.location.href='faq.html' null">test</div>
Click on it again does nothing.


EDIT Prepending the "javascript:" to the onclick attribute, didn't make any difference except the addition of javascript: in the title attribute.

Re: Attempt to fix JavaScript links: not working on relative

Posted: Fri Jan 22, 2016 1:51 am
by NoThing
I tried to put an ABSOLUTE URL, instead of relative URL, in the HTML code of the http://www.science20.com/ page to see if NoScript would make it clickable, but without success :

Code: Select all

<div id=\"feat-main-title\" onclick=\"javascript:window.location.href='http://www.science20.com/cool_science/your_eyes_as_radiation_detectors-162631';\">Your Eyes As Radiation Detectors </div>
I understand NS can not fix all javascript links (for pages with scripts disabled),
but the more it can fix the better of course.

So if a link like the previous one can not be fixed by NS it's better that G. Maone knows about it.
(Either be it a bug/regression in NS or simply a feature not yet added)

This said, Noscript, just before TabMixPlus, is the first extension that I install on any Firefox.

Re: Attempt to fix JavaScript links: not working on relative

Posted: Fri Jan 22, 2016 2:06 am
by barbaz
Moving to NoScript Development.