sanitize.html 758 B

12345678910111213141516171819202122232425
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width" />
  6. <title>Sapphire</title>
  7. </head>
  8. <body>
  9. <script src="../src/sanitize.js"></script>
  10. <script>
  11. let xhr = new XMLHttpRequest();
  12. xhr.onreadystatechange = function() {
  13. if (xhr.readyState == XMLHttpRequest.DONE) {
  14. strs = xhr.responseText.split('\n').map(sanitizeHtmlString);
  15. for (let x of strs) {
  16. document.body.innerHTML += x;
  17. }
  18. }
  19. }
  20. xhr.open('GET', '../vendor/xss.txt', true);
  21. xhr.send(null);
  22. </script>
  23. </body>
  24. </html>