-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Adds TrustedHTML, TrustedScript, TrustedScriptURL #2978
Conversation
Co-authored-by: Joe Medley <[email protected]>
Co-authored-by: Joe Medley <[email protected]>
|
||
<h2 id="Syntax">Syntax</h2> | ||
|
||
<pre class="syntaxbox">var <var>json</var> = <var>TrustedHTML</var>.toJSON();</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to poke an old PR, but this was linked from mdn/browser-compat-data#11063 and I wanted to bring attention to #3487.
https://developer.mozilla.org/en-US/docs/Web/API/TrustedHTML/toJSON now has var json = TrustedHTML.toJSON()
in the syntax block, but TrustedHTML.toJSON()
is not a piece of code that works. TrustedHTML
would need to be some plausible name for an instance of TrustedHTML
, so perhaps escaped.toJSON()
?
Working on documenting the Trusted Types API. This PR adds:
Spec: https://w3c.github.io/webappsec-trusted-types/dist/spec/
Reviewer: @jpmedley
To save yourself some time Joe, these are all pretty much the same as each other so if you want to snag TrustedHTML and the two method pages, I will then apply any changes to the others.
Also, it looks as if toJSON() is only in Canary (I tested it), and we have no BCD for the method. So that will need adding, which I can do if it is going to land.