sanitize.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!--
  2. Sapphire
  3. Copyright (C) 2018 Florrie Haero
  4. Copyright (C) 2018 Alyssa Rosenzweig
  5. Copyright (C) 2018 eq
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
  17. -->
  18. <!DOCTYPE html>
  19. <html>
  20. <head>
  21. <meta charset="utf-8">
  22. <meta name="viewport" content="width=device-width" />
  23. <title>Sapphire</title>
  24. </head>
  25. <body>
  26. <script src="../src/sanitize.js"></script>
  27. <script>
  28. let xhr = new XMLHttpRequest();
  29. xhr.onreadystatechange = function() {
  30. if (xhr.readyState == XMLHttpRequest.DONE) {
  31. document.body.innerHTML = xhr.responseText.split('\n').map(sanitizeHtmlString).join("");
  32. }
  33. }
  34. xhr.open('GET', '../vendor/xss.txt', true);
  35. xhr.send(null);
  36. </script>
  37. </body>
  38. </html>