Closed Bug 519028 Opened 15 years ago Closed 8 years ago

changed location.hash leads to tab favicon disappearance

Categories

(Firefox :: General, defect, P3)

26 Branch
defect
Points:
5

Tracking

()

RESOLVED DUPLICATE of bug 408415

People

(Reporter: gessos.paul, Unassigned)

References

()

Details

(Keywords: testcase, Whiteboard: [sf-hackweek])

Attachments

(1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

Where is the icon, left in the location bar?

Sample page:
---------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml"/>
<link rel="icon" href="favicon.png" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.png" type="image/x-icon"/>
</head>
<body>
<script>
location.hash = 'crapy';
</script>
</body>
</html>
---------------------------------------------

Reproducible: Always
I can confirm this.
The favicon disappears if you change location.hash, from a call AFTER the <link "shortcut icon" /> tag.
(A click on <a onclick="location.hash='crapy';"> or <input type="button" onclick="location.hash='crapy';" /> will not hide the favicon.)

This will hide the favicon:
---------------------------------------------
<html>
<head>
<link rel="shortcut icon" type="image/ico" href="dir/favicon.png" />
<script> location.hash='crapy'; </script>
</head>
</html>
---------------------------------------------

This will not hide the favicon:
---------------------------------------------
<html>
<head>
<script> location.hash='crapy'; </script>
<link rel="shortcut icon" type="image/ico" href="dir/favicon.png" />
</head>
</html>
---------------------------------------------

Tested under Ubuntu 9.10, Firefox 3.5.9
This sounds like a dupe of bug 420605.
I can reproduce this bug with Firefox 3.6.12 running on Windows 7 Enterprise (64bit).

However to reproduce the bug, the HTML document needs to include a stylesheet link in the head section AND the stylesheet must exist.

The following hides the favicon for me:
---------------------------------------
<html>
<head>
<link rel="shortcut icon" type="image/ico" href="favicon.png" />
<link href="foo.css" type="text/css" rel="stylesheet" />
<script> 
location.hash='bogus'; 
</script>
</head>
</html>
---------------------------------------

The following does not hide the favicon:
---------------------------------------
<html>
<head>
<link rel="shortcut icon" type="image/ico" href="favicon.png" />
<script> 
location.hash='bogus'; 
</script>
</head>
</html>
---------------------------------------
This is not a dupe of #420605.
Here is a test case: http://jsbin.com/ulaxo4
Version: unspecified → 3.6 Branch
I can confirm this and have a reproducible test case in work code. It still happens in Firefox 4; it appears to only happen if the hash to be set is not in the document at the moment of setting it (we have this to work around some other browser bug, I forget which at the moment).
Status: UNCONFIRMED → NEW
Ever confirmed: true
(I'm on 64-bit Windows 7 here, but I think it also happens on OS X.)
Version: 3.6 Branch → 4.0 Branch
Just stumbled on this on Windows 7 64-bit, Firefox 9.0 Beta 3
Very good workaround can be found here: http://stackoverflow.com/a/4630726/684229

And yes, Firefox 9.0.1 still has the problem (Windows XP, 32 bit).
This still seems to be a problem in v14.0.1
Still seeing this behavior in v20.0a2.
Firefox 23 also still affected (if it makes sense to report this as apparently the bug hasn't been fixed yet).
+1. Still a problem on Firefox 24 (Linux, 64 bit.) We only see the problem when going from no hash to adding a hash, but we used the detach/re-attach workaround in http://stackoverflow.com/a/4630726/684229 on all hash changes just to be safe.
I can reproduce in 26.0a2, OS X.
OS: Windows XP → All
Hardware: x86 → All
Version: 4.0 Branch → 26 Branch
Keywords: testcase
Attachment #8340226 - Attachment mime type: text/plain → text/html
Comment on attachment 8340226 [details]
Non-working testcase reduced too much from http://jsbin.com/ulaxo4

It's not reproducible without the additional scripts it seems.
Attachment #8340226 - Attachment description: Testcase reduced from http://jsbin.com/ulaxo4 → Non-working testcase reduced too much from http://jsbin.com/ulaxo4
Attachment #8340226 - Attachment is obsolete: true
Component: Location Bar → General
Summary: change location.hash leads to location bar icon disappearance → changed location.hash leads to tab favicon disappearance
Blocks: 718011
Flags: firefox-backlog+
Points: --- → 5
Flags: qe-verify?
Flags: qe-verify?
Flags: qe-verify+
Flags: in-testsuite?
On nightly, this is now also reproducible with about:preferences#advanced and friends.
Whiteboard: [sf-hackweek]
Priority: -- → P3
See Also: → 408415
I put up a patch in bug 408415. Sorry for the double-dupe for folks whose bugs got duped here.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
See Also: 408415
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: