Firefox 148 introduces the Sanitizer API, a standardized way to sanitize untrusted HTML before inserting it into the DOM, providing stronger protection against cross-site scripting (XSS) attacks. The setHTML method integrates sanitization directly into HTML insertion, allowing developers to replace error-prone innerHTML assignments with a safer alternative. This new API aims to fill the gap in XSS protection, especially for existing websites that may not have adopted Content Security Policy (CSP). The Sanitizer API can be combined with Trusted Types for even stronger protections.