• FrostyPolicy@suppo.fi
    link
    fedilink
    arrow-up
    31
    arrow-down
    2
    ·
    edit-2
    1 month ago

    Why would you ever want to route your request like this through a third party especially an ad company? To get the favicon of a site you just request www.example.com/favicon.ico.

    • argv minus one@mastodon.sdf.org
      link
      fedilink
      arrow-up
      10
      ·
      1 month ago

      @FrostyPolicy

      Not necessarily. You need to fetch the HTML of the web page you want the icon for and see if there’s a <link rel=icon> or equivalent HTTP header.

      And yes, this means different pages on the same site can have different icons.

      @Pro

    • bleistift2@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 month ago

      It doesn’t have to be an *.ico file. So you might need to try different file extensions.

      • FrostyPolicy@suppo.fi
        link
        fedilink
        arrow-up
        3
        ·
        1 month ago

        True. I’ve just seen requests to that file in my demo env for web apps I have and I’ve seen my browser request that file by itself when running those locally.

      • kevincox@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 month ago

        /favicon.ico is the only “default” URL. /favicon.ico is usually not an actual “icon” type anymore but PNG or JPG (but with the same URL). Other than that you need to load the HTML and check for Link headers or <link rel=icon> elements. While URLs like /favicon.png may be popular they aren’t part of any actual protocol.