Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
js-xss vs DOMPurify
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Linux
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
DOMPurify
21216.9 Ops/sec
js-xss
191382.6 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.3/dist/purify.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/xss@1.0.15/dist/xss.min.js"></script>
Script Preparation code:
const testString = ` <b>Welcome to safeland</b><br> <a href='javascript:alert(1)'>This is fun</a><br> <img src=x onerror=console.log(1)> `;
Tests:
DOMPurify
const result = DOMPurify.sanitize(testString);
js-xss
const result = filterXSS(testString)