Sets PWA titlebar color from manifest icon and other methods, with optional debug overlay
Dynamically sets the titlebar color for any PWA or website using the largest manifest icon, with fallbacks if the icon isn’t available. Many PWAs or sites don’t define theme-color, causing default gray/white titlebars that don’t match the brand.
How it works: The script grabs the largest icon from the manifest and uses its dominant color. If no icon is available, it falls back to manifest.theme_color, meta name=theme-color, the favicon, or a default color (#121212). It injects before the page renders, updating the titlebar dynamically without duplicates.
Debug Mode: Toggle DEBUG = 1 to show a small overlay with the icon, selected color, and which method determined the titlebar color.
Features: Icon-priority for accurate branding, multiple fallbacks, debug overlay for testing, works on all sites without reinstalling PWAs, default color is customizable in the script.