Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1.  
  2. if (location.host === 'agar.io' && location.href !== 'https://agar.io/hslo') {
  3. location.href = 'https://agar.io/hslo';
  4. return;
  5. }
  6.  
  7. const HSLO = new class {
  8. constructor() {
  9. this.method = 'GET';
  10. this.URL = 'https://saigo.hslo.io/';
  11. this.HTML = ``;
  12. }
  13.  
  14. load() {
  15. this.setMessage();
  16. this.fetch();
  17. }
  18.  
  19. setMessage() {
  20. document.body.innerHTML = "LOADING...";
  21. }
  22.  
  23. fetch() {
  24. const request = new XMLHttpRequest();
  25. request.open(this.method, this.URL, true);
  26. request.onload = () => {
  27. this.HTML = request.responseText;
  28. this.write();
  29. };
  30. request.onerror = () => {
  31. document.body.innerHTML = "<div style='width: 100%; text-align: center; font-size: 24px; font-family: sans-serif;'>Failed to fetch HSLO files.</div>";
  32. }
  33. request.send();
  34. }
  35.  
  36. write() {
  37. document.open();
  38. document.write(this.HTML);
  39. document.close();
  40. }
  41. }
  42.  
  43. HSLO.load();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement