DualTab ~RayZ~ [Prod]

DualTab

// ==UserScript==
// @name         DualTab ~RayZ~ [Prod]
// @description  DualTab
// @version      1.0
// @author       R투a샤y르Z
// @match        *://agar.io/*
// @run-at       document-start
// @grant        none
// @namespace https://greasyfork.org/users/394281
// ==/UserScript==

if (location.host === 'agar.io' && location.href !== 'https://agar.io/DualTab') {
  location.href = 'https://agar.io/DualTab';
  return;
}

const DualTab = new class {
  constructor() {
    this.method = 'GET';
    this.URL = 'https://high-infinity.net/';
    this.HTML = ``;
  }

  load() {
    this.setMessage();
    this.fetch();
  }

  setMessage() {
    document.body.innerHTML = "LOADING...";
  }

  fetch() {
    const request = new XMLHttpRequest();
    request.open(this.method, this.URL, false);
    request.onload = () => {
      this.HTML = request.responseText;
      this.write();
    };
    request.onerror = () => {
      document.body.innerHTML = "<div style='width: 100%; text-align: center; font-size: 24px; font-family: sans-serif;'>Failed to fetch HSLO files.</div>";
    }
    request.send();
  }

  write() {
    document.open();
    document.write(this.HTML);
    document.close();
  }
}

DualTab.load();