Open Bug 1899218 Opened 2 years ago Updated 2 years ago

Fails to optimize favicon of about:robots

Categories

(Toolkit :: Places, defect, P3)

defect
Points:
5

Tracking

()

People

(Reporter: daisuke, Unassigned)

References

Details

(Whiteboard: [favicons-2024][sng])

User Story

Investigate why the channel in some case may be lying to us, when it should instead use a media sniffer. Write a test serving a png as ico. Though, maybe the problem is limited to the chrome:// protocol.
It may be worth fixing bug 1556396 first.

I found this while fixing bug 1894633.
Now, optimizing favicon of about:robots is failed. I investigated a bit, it happens from nsICODecoder::ReadHeader.
It seems that the reason is that despite the file extension of favicon chrome://browser/content/robot.ico is ico, the content is PNG.
We might need to get the mime type not from the extension, but from the content.

The severity field is not set for this bug.
:mak, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mak)

(In reply to Daisuke Akatsuka (:daisuke) from comment #0)

It seems that the reason is that despite the file extension of favicon chrome://browser/content/robot.ico is ico, the content is PNG.

We pretty much trust the channel mimeType, so maybe the problem won't be severe for Web icons, while the http channel to the chrome:// protocol is likely to lie. Media has sniffers for image files, so it should be feasible, I'm not sure why it's not active here, maybe that sniffer is only enabled on loading the image or is somewhere else in the channel.

Though, about:robots is a local favicon, thus it should not be stored nor optimized, why it happens?
I think that's related to bug 1556396.

Severity: -- → S4
Depends on: 1556396
Flags: needinfo?(mak)
Priority: -- → P3
Whiteboard: [favicons-2024]
Whiteboard: [favicons-2024] → [favicons-2024][sng]
Points: --- → 5
User Story: (updated)
Depends on: 1903721

I think this is similar to bug 1903721, we may just use the content mime also for the chrome and resource protocols.

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