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

Support Trusted Types #478

Closed
tosmolka opened this issue Oct 1, 2021 · 1 comment · May be fixed by #479
Closed

Support Trusted Types #478

tosmolka opened this issue Oct 1, 2021 · 1 comment · May be fixed by #479

Comments

@tosmolka
Copy link

tosmolka commented Oct 1, 2021

To support older browsers, Sizzle manipulates DOM by setting innerHTML property and then queries the results via querySelectorAll. This is problematic when Sizzle lib is used by a modern web app that enforces Trusted Types as all such assignments will fail.

It would be ideal to rewrite the code to avoid innerHTML and only use DOM manipulation methods such as createElement, appendChild or setAttribute. This might not be trivial though as such refactoring could change behavior in older browsers and break the functionality.

Alternatively, Sizzle could create custom Trusted Types policy and use method createHTML for all custom HTML strings.

See https://w3c.github.io/webappsec-trusted-types/dist/spec/ for more details about the spec.

@mgol
Copy link
Member

mgol commented Sep 7, 2023

The PR has a discussion on this proposal. We're about to archive Sizzle and, in fact, jQuery versions from 3.7.0 & up do not rely on Sizzle. Therefore, we don't plan to address this issue.

@mgol mgol closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants