News for hackers. Stuff that matters.
Re:SVG favicons have some cool benefits by dmit on Wednesday July 07, 2021 @01:48PM (#27763853)
Awkward ad intermission

Tired of all the "404 Not Found: /favicon.ico" log messages from your local test server? Fret no more! Just add this minor incantation to your HTML and you're set!

  <link rel="icon" href="data:," />
Re:SVG favicons have some cool benefits by teddyh on Wednesday July 07, 2021 @02:04PM (#27764027)
I prefer this:

    <link rel="icon" href="data:image/svg+xml,%3csvg%3e %3c/svg%3e">
Re:SVG favicons have some cool benefits by memco on Wednesday July 07, 2021 @02:15PM (#27764143)
Why is that preferable?
Re:SVG favicons have some cool benefits by teddyh on Wednesday July 07, 2021 @02:51PM (#27764522)
Because it’s a valid image.
Re:SVG favicons have some cool benefits by chrismorgan on Wednesday July 07, 2021 @02:59PM (#27764611)
No it’s not: the root <svg> element must exist in the http://www.w3.org/2000/svg namespace, or the file won’t be valid SVG and won’t be rendered.

Alas for my beautiful short form that won’t work after all:

  <link rel=icon href=data:image/svg+xml,<svg/%3E>
I’ll just have to settle for this:

  <link rel=icon href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'/>">
Note, however, that by making it a valid SVG file, the browser will render an empty favicon, rather than saying “this page has no favicon” and either leaving the space out or putting some default icon in instead. Consequently, `data:,` is almost certainly preferable.

(If you’re not sure why I worded the namespaces remark so rather than just talking about an xmlns attribute, here’s some valid SVG: <foo:svg xmlns:foo="http://www.w3.org/2000/svg"/>.)

Re:SVG favicons have some cool benefits by sdflhasjd on Wednesday July 07, 2021 @02:31PM (#27764309)
Because it has all the cool benefits of SVG :p
Re:SVG favicons have some cool benefits by soheil on Wednesday July 07, 2021 @06:08PM (#27766288)
why not just

  touch favicon.ico
so it gets cached and forget about it?
Re:SVG favicons have some cool benefits by _ZeD_ on Thursday July 08, 2021 @12:15AM (#27768414)
Too easy
Re:SVG favicons have some cool benefits by blacksmith_tb on Wednesday July 07, 2021 @02:03PM (#27764021)
Seems like the author is ahead of you, inlining the svg in your head tag should fix that too?