wsemi
Version:
A support package for web developer.
30 lines (24 loc) • 1.1 kB
HTML
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>examples for clearXSS(xss)</title>
<!-- @babel/polyfill已廢棄 -->
<script nomodule src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.12.1/dist/polyfill.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xss@1.0.14/dist/xss.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/wsemi@1.7.19/dist/wsemi.umd.js"></script>
<script>
let log = console.log
console.log = function(){
log.apply(null, arguments)
wsemi.bodyLog.apply(null, arguments)
}
</script>
</head>
<body>
<script>
console.log("clearXSS('<img src=\"javascript:alert('XSS')\">')", wsemi.clearXSS('<img src="javascript:alert(\'XSS\')">') )
console.log("clearXSS('<img src=\"http://888.888.com/999.png\" onerror=\"alert('XSS')\">')", wsemi.clearXSS('<img src="http://888.888.com/999.png" onerror="alert(\'XSS\')">') )
</script>
</body>
</html>