Skip to content
Nazmul Nikhil
Menu

Mitigate DOM-Based XSS With Trusted Types (PageSpeed Insights)

PageSpeed checks whether your CSP requires Trusted Types. It's informational and mainly for developers. Here's what it means.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Mitigate DOM-Based XSS With Trusted Types (PageSpeed Insights)
Photo: Nerene Grobler on Unsplash

In short

Trusted Types is a browser feature, turned on through CSP, that blocks unsafe ways of inserting HTML with JavaScript (like setting innerHTML with untrusted text). PageSpeed lists it as informational; few marketing sites use it, and it requires code changes. It's worth it for apps handling user input. For most brochure sites, leave it to a developer and focus on scored checks first.

Content-Security-Policy: require-trusted-types-for 'script'

This guide isn't affiliated with or endorsed by Google.

Sources and references

TAGSPageSpeed InsightsMitigate dom-based xss with trusted typesTrusted types cspRequire-trusted-types-for
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Page Speed & Core Web Vitals posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com