Skip to content

Added support for Trusted Types.#310

Merged
cure53 merged 4 commits into
cure53:masterfrom
koto:trusted-types
Oct 31, 2018
Merged

Added support for Trusted Types.#310
cure53 merged 4 commits into
cure53:masterfrom
koto:trusted-types

Conversation

@koto

@koto koto commented Oct 31, 2018

Copy link
Copy Markdown
Contributor

DOMPurify detects if TrustedTypes are available. If so, will create an inner no-op policy, with a name 'dompurify', optionally suffixed with a value specified in a data-tt-policy-suffix attribute of the script using DOMPurify. It will use that policy when interacting with the (dirty) DOM, and will return a TrustedHTML object instead of a string.

See https://github.com/WICG/trusted-types.

This enables DOMPurify to be used on documents that have enforced Trusted Types API (see e.g. http://tinyurl.com/tttpac), and in general helps migrating web applications using DOMPurify to Trusted Types.

koto and others added 4 commits October 31, 2018 17:35
DOMPurify detects if TrustedTypes are available. If so, will create an inner no-op policy, with a name 'dompurify', optionally suffixed with a value specified in a data-tt-policy-suffix attribute of the script using DOMPurify. It will use that policy when interacting with the (dirty) DOM, and will return a TrustedHTML object instead of a string.

See https://github.com/WICG/trusted-types.
@cure53

cure53 commented Oct 31, 2018

Copy link
Copy Markdown
Owner

Wow, this looks amazing, thank you! I cannot spot any problems for now, going for a merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants