mozilla / eslint-plugin-no-unsanitized

Custom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
Mozilla Public License 2.0
222 stars 33 forks source link

Consider supporting the browser-native HTML Sanitizer API #197

Closed mangs closed 2 years ago

mangs commented 2 years ago

Hi folks. Thanks for the useful tool. 😀

Current DOM sanitizer libraries can be fairly large. Happily, there's an upcoming standard being considered that does the same thing but is native to the browser. I'm hoping it comes to Deno and Node.js too.

You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API

Would be great if you picked up support for this once at least one major browser engine gets stable support for it.

mangs commented 2 years ago

Here's an overview article too if it helps: https://blog.logrocket.com/what-you-need-know-inbuilt-browser-html-sanitization/

mozfreddyb commented 2 years ago

That's a great idea. I really like the Sanitizer API too.