Change favicon on switching browser tabs in JavaScript

7 · Amit Merchant · March 7, 2023, 5:38 p.m.
I was browsing through my Twitter feed and I saw something pretty subtle yet mind-blowing. One of the guys from the Astro team was showing off some of the new things they have done for their brand redesign. One of the things that caught my attention was the favicon that changes when you switch between browser tabs. Essentially, the favicon changes to a grayscale version of the original favicon when the tab is inactive and changes back to the original favicon when the tab is active. It looked p...