Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve usability of TrustedTypes API #175

Open
ditman opened this issue Feb 16, 2024 · 0 comments
Open

Improve usability of TrustedTypes API #175

ditman opened this issue Feb 16, 2024 · 0 comments

Comments

@ditman
Copy link
Member

ditman commented Feb 16, 2024

TrustedTypes definitions have landed, but please consider the following changes to the API to make it more usable:

  1. Make trustedTypes nullable, or provide a way to check if trustedTypes are available. TrustedTypes is a Chrome-only feature, and is undefined when not available. This is what I needed to do the last time I used TT:
  2. Also, it's needed for certain types to have setters that accept their TrustedType value, like: script.src and element.innerHtml (and have: script.trustedSrc and element.trustedInnerHtml...), for example:
  3. Also also, the second parameter to createScriptURL (and probably all other create functions) must be optional. I needed to override the method last time I used this:

/cc @kevmoo

TL;DR: Take this, fill in the gaps and make it part of package:web ppppplease :P

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

No branches or pull requests

1 participant