A favicon, which is short for favorite icon, is a small icon that appears in the browser tab, address bar, bookmarks, and search results. Websites are often recognized and identified by their favicons. This article describes how to fix the problem of your favicon not appearing (or not updating) in Bing search results.
Adding a badge to the favicon using JavaScript can be done by updating the image specified by the <link /> element with a new icon image.
This method involves JavaScript and creating an in-memory canvas element, applying the favicon image, drawing the badge shape and text on top, and then updating the <link /> element’s href attribute with the final composite of the canvas element’s image data as a Base64 encoded string.