Closed Bug 1038290 Opened 10 years ago Closed 10 years ago

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

Categories

(SeaMonkey :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.30

People

(Reporter: philip.chee, Assigned: philip.chee)

Details

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

Attachments

(1 file, 1 obsolete file)

(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
Attached patch Patch v1 proposed fix. (obsolete) — Splinter Review
Tested at http://gijsk.com/mozilla/testcases/icons.html (from bug 577892 comment 7)
Attachment #8455483 - Flags: review?(neil)
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?
(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 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+
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/df9ba9a12820
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.30
You need to log in before you can comment on or make changes to this bug.