Feature Request: Javascript Hyperlinks

Bug reports and enhancement requests
Post Reply
panic
Posts: 1
Joined: Fri Oct 30, 2009 1:58 pm

Feature Request: Javascript Hyperlinks

Post by panic »

Clicking on a javascript hyperlink should be treated in the same as clicking on a placeholder. Its rather annoying to have to temporarily enable / reload, just to navigate away from a page. Ideally, the page permissions should not change, and other denied javascript on the page should not run. reuters.com is a decent example. Most articles on the site have a continue link at the bottom that is in javascript.

While acknowledging my complete lack of knowledge on how this stuff works internally, I see the process as follows:
1. trap hyperlink clicks that lead to javascript errors and pop a noscript "temporarily allow" dialog.
2. add javascript to the document (except for naked javascript not in a function), but don't reload, so that unrelated events don't fire.
3. reinject the javascript in the hyperlink
4. remove the js added in step 2.
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.12) Gecko/2009072220 Iceweasel/3.0.6 (Debian-3.0.6-1)
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Feature Request: Javascript Hyperlinks

Post by therube »

I believe this is already done, though not always successfully.

Options | Advanced -> Untrusted => Attempt to fix JavaScript links

In the case of Reuters, the "Continued..." JavaScript link does not get resolved properly, so you then need to Allow reuters.com to continue.

(I can't stand sites that use JavaScript for purposes like that.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0
Tom T.
Field Marshal
Posts: 3620
Joined: Fri Mar 20, 2009 6:58 am

Re: Feature Request: Javascript Hyperlinks

Post by Tom T. »

therube wrote:Options | Advanced -> Untrusted => Attempt to fix JavaScript links

In the case of Reuters, the "Continued..." JavaScript link does not get resolved properly, so you then need to Allow reuters.com to continue.
Agree -- I have NoScript configured as therube said, yet I find that frequently, you must Temp Allow the page for the link to work, at many sites besides Reuters. (Guess that's why it says "Attempt" rather than "Fix". ;) )
therube wrote:(I can't stand sites that use JavaScript for purposes like that.)
Nor I. Non-rhetorical question: Do you have any idea *why* they do that? What do they gain as opposed to a simple HTML link?

Code: Select all

<a href="http://www.reuters.com/article/worldNews/idUSTRE59T12H20091030?pageNumber=2&virtualBrandChannel=11621">Continued...</a> 
would do just as well, no?

Here it is as a live link in BBCode:
Continued...

I can understand how the link, "View entire article on one page" might use some JS to reformat the page, per some standard template, so that they don't have to do that for each article individually. But *what* is the "benefit" to them of using JS for a simple link to another page? :?:

Unless it's to *force* NS users to allow their scripting, so that more of their ads and other junk can run? :evil:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
Post Reply