A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, SVG and MathML. It's also very simple to use and get started with. DOMPurify was started in February 2014 and, meanwhile, has reached version 2.3.0. DOMPurify is written in JavaScript and works in all modern browsers (Safari (10+), Opera (15+), Internet Explorer (10+), Edge, Firefox and Chrome - as well as almost anything else using Blink or WebKit). It doesn't break on MSIE6 or other legacy browsers. It either uses a fall-back or simply does nothing. Our automated tests cover 17 different browsers right now, more to come. We also cover Node.js v14.15.1, v15.4.0, running DOMPurify on jsdom. Older Node.js versions are known to work as well. DOMPurify is written by security people who have vast background in web attacks and XSS.

Features

  • DOMPurify sanitizes HTML and prevents XSS attacks
  • You can feed DOMPurify with string full of dirty HTML and it will return a string (unless configured otherwise) with clean HTML
  • DOMPurify will strip out everything that contains dangerous HTML
  • Prevents XSS attacks and other issues
  • The faster your browser, the faster DOMPurify will be
  • Just include DOMPurify on your website

Project Samples

Project Activity

See All Activity >

Categories

HTML/XHTML

License

Apache License V2.0, Mozilla Public License 2.0 (MPL 2.0)

Follow DOMPurify

DOMPurify Web Site

nel_h2
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of DOMPurify!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript HTML XHTML

Registered

2021-08-09