Open Bug 494876 Opened 15 years ago Updated 2 years ago

Status bar isn't updated when JavaScript changes an anchor's href

Categories

(Firefox :: General, defect)

8 Branch
x86
Windows XP
defect

Tracking

()

People

(Reporter: awatts, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

327 bytes, text/html
Details
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

When hovering over an anchor the status bar displays the link.  However if JavaScript subsequently changes the href of the anchor the status bar is not updated.  If the link is to a trusted site, but the JavaScript subsequently changes it to an untrusted site the user would not know what they were clicking on.  This is not really any different than an onClick handler of an anchor taking the user somewhere else, but here we do have the link.  IE 7 and Opera 9.63 do not suffer with this.

Reproducible: Always

Steps to Reproduce:
1.  Create an html file with this content:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
  <script type="text/javascript">

$(function() {

    $('a').hover(function () {
        this.href = "http://example.com/UNTRUSTED-URL"
    }).mouseout(function () {
        this.href = "http://example.com/trusted-url"
    })
})

  </script>
</head>

    <a href="http://example.com/trusted-url">Look at the status bar URL and then see what this opens!</a>

<body>
</body>
</html>

2.  View that page in Firefox
3.  Look at the status bar with the mouse over the link
4.  Click the link
Actual Results:  
The browser is redirected to the "unseen" location.

Expected Results:  
The status bar should present the current href of the anchor

The status bar should be updated when the anchor's href is updated.
Attached file testcase (obsolete) —
Attached file testcase
Attachment #379686 - Attachment is obsolete: true
=> Duplicate of bug 229050
This is not a duplicate of bug 229050.  That bug is saying the presence of an onclick handler setting location.href is misleading the user.

This bug is to do with some JavaScript changing the href, but the browser not showing the change.  The difference is subtle, but it is different.
Reporter, please retest with Firefox 3.6.12 or later in a fresh profile (http://support.mozilla.com/kb/Managing+profiles). Also update your plugins (flash, adobe reader, java, quicktime, silverlight, etc.) Go to the developer's website and download the latest version from there. If you no longer see this issue, please close this bug as RESOLVED, WORKSFORME. If you do see the bug, please post a comment.
Whiteboard: [CLOSEME 2010-12-01]
No reply, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
Retested in Firefox 3.6.12 in a new profile and in a new install on a blank XP Virtual Machine.  The problem is still present.
Status: RESOLVED → UNCONFIRMED
Resolution: INCOMPLETE → ---
Whiteboard: [CLOSEME 2010-12-01]
Version: unspecified → 3.6 Branch
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5? Does the issue occur with the latest nightly? http://nightly.mozilla.org/
Still an issue on Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110802 Firefox/8.0a1 ID:20110802030845

Confirming in General so someone can determine if they want to mark as a duplicate of bug 229050 or if this stands on its own.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 3.6 Branch → 8 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: