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

Insufficient feature detection in Chrome 105 Beta #156

Open
WIStudent opened this issue Aug 24, 2022 · 3 comments
Open

Insufficient feature detection in Chrome 105 Beta #156

WIStudent opened this issue Aug 24, 2022 · 3 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@WIStudent
Copy link
Contributor

WIStudent commented Aug 24, 2022

Currently Chrome 105 Beta ships with a basic implmentation of the Sanitizer API, but keeps the .sanitize and .sanitizeFor methods hidden behind the enable-experimental-web-platform-features flag.
https://chromestatus.com/feature/5786893650231296

If this flag is not enabled the window.Sanitizer constructor exists, but the object it creates does not have the .sanatize and .sanitizeFor methods. The polyfill currently only checks if window.Sanitizer is a function to decide if it needs to polyfill the API. This means that in Chrome 105 Beta the polyfill is not applied and the .sanitize and .sanitizeFor are missing. Should the final Chrome 105 version ship like this a more complex feature detection is needed.

EDIT: Spell "sanitize" correctly :)

@mozfreddyb
Copy link
Collaborator

I believe we need to change what this polyfill does. We at Firefox and Chrome agree that we only want to ship the constructor and the setHTML bits at first.

I suppose this means we want to remove the sanitize and sanitizeFor methods on the constructor as well. (One could think of a clever way of disabling it which I wouldn't be opposed to. But we're also using version control so I don't see the need to keep it around much)

(P.S: You're spelling sanitize wrong a couple of times :))`

@mozfreddyb mozfreddyb added enhancement New feature or request bug Something isn't working labels Aug 29, 2022
@mozfreddyb
Copy link
Collaborator

To resolve this, we shouldn't expose the sanitize... methods on the constructor.

@WIStudent
Copy link
Contributor Author

WIStudent commented Aug 29, 2022

We at Firefox and Chrome agree that we only want to ship the constructor and the setHTML bits at first.

In that case I agree with removing the .sanitize and .sanitizeFor methods from the polyfill for now.

@mozfreddyb mozfreddyb added the help wanted Extra attention is needed label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants