Lessons from open-source: Use window.trustedTypes to prevent DOM XSS.
This lesson is picked from Next.js source code. In this article, you will learn what are window.trustedTypes.
I was looking at client/trusted-types.ts and found window.trustedTypes?.createPolicy. At first, I thought trustedTypes must be an Object se...
ramunarasinga.hashnode.dev2 min read