MCPcopy Index your code
hub / github.com/cure53/DOMPurify / dirtyMixed

Function dirtyMixed

scripts/benchmark.js:154–167  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

152}
153
154function dirtyMixed(n) {
155 // Realistic dirty input: things to strip, hoist and rewrite.
156 let html = '';
157 for (let i = 0; i < n; i++) {
158 html +=
159 `<div onclick="alert(${i})"><script>steal(${i})</script>` +
160 `<img src="x" onerror="alert(${i})">` +
161 `<a href="javascript:alert(${i})">bad link ${i}</a>` +
162 `<unknown-tag-${i % 3}><b>kept ${i}</b></unknown-tag-${i % 3}>` +
163 `<p style="position:fixed">text ${i}</p></div>`;
164 }
165
166 return html;
167}
168
169/* ------------------------------------------------------------------ */
170/* Scenarios */

Callers 1

benchmark.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…