web-platform-tests / web-platform-tests/interop

Web Sanitizer API

Open
#1,336 1 comment 79 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

focus-area-proposal
Dominant language
JavaScript
Stars
524
Forks
35
Avg merge
1d 4h
Merged PRs (30d)
10

Description

Description
  • The setHTML() method inserts HTML into the DOM in a way that prevents cross-site scripting attacks.
  • The parseHTML() method of the Document object provides an XSS-safe method to parse and sanitize a string of HTML in order to create a new Document.

I will limit the scope to setHTML() and Document.parseHTML().

There is a separate Interop proposal for the streaming methods, so please also vote for that.

Specification

https://html.spec.whatwg.org/#html-sanitization

web-feature

https://web-platform-dx.github.io/web-features-explorer/features/sanitizer/

Test Links

https://wpt.fyi/results/sanitizer-api

Additional Signals

Webkit standard position: positive

This feature has been supported since Chrome and Edge version 146 and Firefox version 148.
This tweet has 445 likes.
This Bluesky post has 203 likes.
The Sanitizer API has 79 votes in the developer signals repo, making it one of the most popular features (eleventh place out of 358 features).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the HTML specification's HTML sanitization section and review the sanitizer-api results on wpt.fyi. The scope is limited to setHTML() and Document.parseHTML(); done means Interop coverage reflects those methods, without taking on the separate streaming-methods proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.