Last Comment Bug 519028 - changed location.hash leads to tab favicon disappearance
: changed location.hash leads to tab favicon disappearance
Status: RESOLVED DUPLICATE of bug 408415
[sf-hackweek]
: testcase
Product: Firefox
Classification: Client Software
Component: General (show other bugs)
: 26 Branch
: All All
: P3 normal with 11 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://jsbin.com/ulaxo4
: 1028921 1062644 1143919 1177008 (view as bug list)
Depends on:
Blocks: 718011
  Show dependency treegraph
 
Reported: 2009-09-26 04:51 PDT by chameleon
Modified: 2016-02-10 06:52 PST (History)
22 users (show)
MattN+bmo: firefox‑backlog+
gijskruitbosch+bugs: in‑testsuite?
gijskruitbosch+bugs: qe‑verify+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: 5
Has Regression Range: ---
Has STR: ---


Attachments
Non-working testcase reduced too much from http://jsbin.com/ulaxo4 (458 bytes, text/html)
2013-11-28 22:28 PST, Matthew N. [:MattN] (behind on reviews)
no flags Details

Description chameleon 2009-09-26 04:51:38 PDT
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
Comment 1 Alliz Gub 2010-07-21 14:32:27 PDT
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
Comment 2 Philipp von Weitershausen [:philikon] 2010-08-23 07:09:29 PDT
This sounds like a dupe of bug 420605.
Comment 3 Eddie Stanley 2010-11-30 14:57:19 PST
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>
---------------------------------------
Comment 4 dziastinux 2011-03-28 00:29:05 PDT
This is not a dupe of #420605.
Here is a test case: http://jsbin.com/ulaxo4
Comment 5 Dirkjan Ochtman (:djc) 2011-04-08 08:31:10 PDT
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).
Comment 6 Dirkjan Ochtman (:djc) 2011-04-08 08:32:08 PDT
(I'm on 64-bit Windows 7 here, but I think it also happens on OS X.)
Comment 7 JB 2011-11-24 13:54:46 PST
Just stumbled on this on Windows 7 64-bit, Firefox 9.0 Beta 3
Comment 8 Tomas Telensky 2012-01-24 02:09:47 PST
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).
Comment 9 Rob G 2012-08-03 10:55:43 PDT
This still seems to be a problem in v14.0.1
Comment 10 Brian Hauer 2013-01-28 14:32:42 PST
Still seeing this behavior in v20.0a2.
Comment 11 Jan Pokorný 2013-08-27 16:35:21 PDT
Firefox 23 also still affected (if it makes sense to report this as apparently the bug hasn't been fixed yet).
Comment 12 Greg Sheremeta 2013-11-01 07:45:26 PDT
+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.
Comment 13 Dirkjan Ochtman (:djc) 2013-11-01 07:57:23 PDT
I can reproduce in 26.0a2, OS X.
Comment 14 Matthew N. [:MattN] (behind on reviews) 2013-11-28 22:28:22 PST
Created attachment 8340226 [details]
Non-working testcase reduced too much from http://jsbin.com/ulaxo4
Comment 15 Matthew N. [:MattN] (behind on reviews) 2013-11-28 22:34:33 PST
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.
Comment 16 Matthew N. [:MattN] (behind on reviews) 2014-06-23 11:39:47 PDT
*** Bug 1028921 has been marked as a duplicate of this bug. ***
Comment 17 microrffr 2014-09-04 11:39:08 PDT
*** Bug 1062644 has been marked as a duplicate of this bug. ***
Comment 18 :Gijs Kruitbosch 2014-11-19 14:52:21 PST
On nightly, this is now also reproducible with about:preferences#advanced and friends.
Comment 19 :Gijs Kruitbosch 2015-06-11 07:00:57 PDT
*** Bug 1143919 has been marked as a duplicate of this bug. ***
Comment 20 :Gijs Kruitbosch 2016-02-10 01:36:59 PST
*** Bug 1177008 has been marked as a duplicate of this bug. ***
Comment 21 :Gijs Kruitbosch 2016-02-10 06:52:33 PST
I put up a patch in bug 408415. Sorry for the double-dupe for folks whose bugs got duped here.

*** This bug has been marked as a duplicate of bug 408415 ***

Note You need to log in before you can comment on or make changes to this bug.