Update the favicon when the href attribute of link rel="icon" is changed

RESOLVED FIXED in seamonkey2.30

Status

SeaMonkey
Tabbed Browser
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Philip Chee, Assigned: Philip Chee)

Tracking

Trunk
seamonkey2.30

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [parity-Firefox][parity-Chrome][parity-IE])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
(From Bug 577892 comment #0)
> User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.2.6)
> Gecko/20100625 Firefox/3.6.6
> Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9.2.6)
> Gecko/20100625 Firefox/3.6.6
> 
> ive created a test page to reproduce this behavior. youd except icon would
> change after button click, but it doesnt. the href attribute changes. when i
> drag a panel into a new firefox window, new icon is already shown, so i
> guess its problem with user interface rendering.
> 
> <html>
>   <head>
>     <title>Test</title>
>     <link rel="icon" href="calm.png"/>
>   </head>
>   <body>
>     <button
> onclick="document.getElementsByTagName('link')[0].href='hot.png';">Simulate
> Event</button>
>   </body>
> </html>
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> try the example code in description
> Actual Results:  
> icon doesnt invalidate
> 
> Expected Results:  
> icon should change to a new one
(Assignee)

Comment 1

3 years ago
Created attachment 8455483 [details] [diff] [review]
Patch v1 proposed fix.

Tested at http://gijsk.com/mozilla/testcases/icons.html (from bug 577892 comment 7)
Attachment #8455483 - Flags: review?(neil)

Comment 2

3 years ago
Comment on attachment 8455483 [details] [diff] [review]
Patch v1 proposed fix.

Nice, but this would push multiple updates for the same feed if the href changed, can you do something about that?
(Assignee)

Comment 3

3 years ago
Created attachment 8458669 [details] [diff] [review]
Patch v2 return early if event type is "DOMLinkChanged"

(In reply to neil@parkwaycc.co.uk from comment #2)

> Nice, but this would push multiple updates for the same feed if the href
> changed, can you do something about that?
I've added an early return if the event type is "DOMLinkChanged"
Attachment #8455483 - Attachment is obsolete: true
Attachment #8455483 - Flags: review?(neil)
Attachment #8458669 - Flags: review?(neil)

Comment 4

3 years ago
Comment on attachment 8458669 [details] [diff] [review]
Patch v2 return early if event type is "DOMLinkChanged"

Note to self: testing works better if your build supports the DOMLinkChanged event.
Attachment #8458669 - Flags: review?(neil) → review+
(Assignee)

Comment 5

3 years ago
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/df9ba9a12820
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.30
You need to log in before you can comment on or make changes to this bug.