Capture failures of static assets (img/script/link for CSS/fonts, etc.) and CSP violations.
Reports are sampled, deduped, and rate limited. Returns an uninstall function.
Implementation notes:
Uses a window-level "error" listener in the capture phase so it catches resource errors
that do not bubble (e.g., , failures).
Serializes only safe, compact details about the target element and URL.
Adds a separate listener for "securitypolicyviolation" when enabled.
Capture failures of static assets (img/script/link for CSS/fonts, etc.) and CSP violations. Reports are sampled, deduped, and rate limited. Returns an uninstall function.
Implementation notes: