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

Add more tests for trusted-types-sink violation reports. #50276

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

fred-wang
Copy link
Contributor

@fred-wang fred-wang commented Jan 24, 2025

This covers all Window-only sinks listed in
w3c/trusted-types#494 (comment)

This also relies on connect-src / EventSource / self.add/removeEventListner, so
that the file could be usable in Workers in the future.

@fred-wang fred-wang requested a review from lukewarlow January 24, 2025 17:26
@wpt-pr-bot wpt-pr-bot requested a review from mikewest January 24, 2025 17:26
@fred-wang fred-wang marked this pull request as draft January 24, 2025 18:53
@fred-wang fred-wang marked this pull request as ready for review January 27, 2025 08:49
This covers all Window-only sinks listed in
w3c/trusted-types#494 (comment)

This also adds small improvements to csp-violations.js:

- Rely on connect-src / EventSource / self.add/removeEventListner, so
  that the file could be usable in Workers in the future.

- Also force a connect-src violation before executing fn, so that we
  can flush previously reported violations. Although this is not
  necessary for existing tests, I noticed this can sometimes happen
  when I was trying to write tests.
@fred-wang fred-wang force-pushed the trusted-types-reporting branch from bfb43e4 to a2c185e Compare January 29, 2025 06:39
@fred-wang fred-wang merged commit 2817c97 into master Jan 30, 2025
17 checks passed
@fred-wang fred-wang deleted the trusted-types-reporting branch January 30, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants