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

Adds TrustedHTML, TrustedScript, TrustedScriptURL #2978

Merged
merged 5 commits into from
Mar 22, 2021

Conversation

rachelandrew
Copy link
Collaborator

Working on documenting the Trusted Types API. This PR adds:

  • TrustedHTML
  • TrustedScript
  • TrustedScriptURL

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.

@rachelandrew rachelandrew requested a review from a team as a code owner March 9, 2021 15:32
@rachelandrew rachelandrew requested review from Rumyra and jpmedley and removed request for a team and Rumyra March 9, 2021 15:32
files/en-us/web/api/trustedhtml/index.html Outdated Show resolved Hide resolved
files/en-us/web/api/trustedhtml/index.html Outdated Show resolved Hide resolved
files/en-us/web/api/trustedhtml/index.html Outdated Show resolved Hide resolved
files/en-us/web/api/trustedhtml/index.html Outdated Show resolved Hide resolved
files/en-us/web/api/trustedhtml/index.html Show resolved Hide resolved

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">var <var>json</var> = <var>TrustedHTML</var>.toJSON();</pre>
Copy link
Contributor

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()?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants