Advertisement
Golden-ifpass

ifloader 1.1.0

Sep 20th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ifloader 1.1.0 by Golden. Loads the latest version of ifpass, using Pastebin. Requires an internet connection. */
  2. /* This version doesn't require jQuery! */
  3. var pastebin = "https://api.allorigins.win/get?url=" + "https://pastebin.com/raw/k4mc1nZE";
  4. var ifloaded;
  5. var func = () => {
  6.     if ( !ifloaded ) {
  7.         document.body.innerHTML += "ifloader 1.1.0 by Golden. Pastebin: https://pastebin.com/WP8ARKNU";
  8.         console.log("Loading ifloader...");
  9.         var getIFPASS = new XMLHttpRequest();
  10.         var response = null;
  11.  
  12.         getIFPASS.open("GET", pastebin, true); /* true for asynchronous */
  13.         getIFPASS.onreadystatechange = () => {
  14.             if (getIFPASS.readyState === 4) {
  15.                 if (getIFPASS.status === 200) {
  16.                     var script = document.createElement("script");
  17.                     response = getIFPASS.responseText;
  18.                     /* console.log(JSON.parse(response).contents); */
  19.                     document.body.innerHTML += "<br>Loading ifpass...";
  20.                     console.log("Loading ifpass...");
  21.                     document.body.innerHTML = "";
  22.                     document.body.appendChild(script).src = JSON.parse(response).contents;
  23.                 } else {
  24.                     if (getIFPASS.status !== 0) {
  25.                         document.body.innerHTML += '<p style="color:red">HTTP Error ' + getIFPASS.status + '! Reloading page in 5 seconds...</p>';
  26.                         console.log("HTTP Error " + getIFPASS.status + "! Reloading page in 5 seconds...");
  27.                     } else {
  28.                         document.body.innerHTML += '<p style="color:red">Reconnect to the Internet. Reloading page in 5 seconds...</p>';
  29.                         console.log("Reconnect to the Internet. Reloading page in 5 seconds...");
  30.                     }
  31.                     setTimeout(() => {document.location.reload()}, 5000);
  32.                 }
  33.                 console.log("HTTP Status: " + getIFPASS.status);
  34.             }
  35.         };
  36.         getIFPASS.send(null);
  37.         document.body.innerHTML += "<br>Downloading the latest version of ifpass...";
  38.         console.log("Downloading the latest version of ifpass...");
  39.     };
  40.     ifloaded = true;
  41. };
  42. if (!ifloaded) {
  43.     document.body.innerHTML = "";
  44.     document.head.innerHTML += "<style> element { margin:0; padding:0; font-size:100%; line-height:1; } </style>";
  45.     try {
  46.         func();
  47.     } catch {
  48.         setTimeout(func, 2000);
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement