Vug::GrayPlaceholderHandler
Detects gray/placeholder favicon images and generates fallback URLs. Extracted from Fetcher to follow Single Responsibility Principle.
Constants
DuckDuckGo's default icon returned when it has no real favicon for a domain. This is a 32x32 PNG always at exactly 2441 bytes.
Regex to extract domain from DuckDuckGo /ip3/{domain}.ico URLs.
Google favicon API size parameter — kept as a local constant for google_larger_url regex replacement within this handler.
Upper bound on the number of fallback attempts the fetch loop will make when it keeps receiving gray placeholders. The loop terminates with a :too_many_gray_placeholder_attempts error once the counter reaches this value.
Constructors
Instance methods
Try to find a cached larger version of a gray placeholder. Returns the cached path if found, nil otherwise.
Generate a fallback URL for fetching a non-gray version of the favicon.
Returns true if the fetched data is a known gray placeholder image.