From 4396e358874f98d7d1d06556d7f4450281edec15 Mon Sep 17 00:00:00 2001 From: Lucas <18538046+TeaWithLucas@users.noreply.github.com> Date: Sat, 29 Jun 2019 14:15:10 +0100 Subject: [PATCH] Update Autoloader.js --- Autoloader.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Autoloader.js b/Autoloader.js index 9e20f7f..990c06a 100644 --- a/Autoloader.js +++ b/Autoloader.js @@ -4,7 +4,7 @@ // @namespace https://github.com/TeaWithLucas/Herosaver/ // @description Autoloader for the Herosaver Script // @version 1 -// @include *example.org/* +// @include *example.com/* // @installURL https://raw.githubusercontent.com/TeaWithLucas/Herosaver/master/Autoloader.js // @downloadURL https://raw.githubusercontent.com/TeaWithLucas/Herosaver/master/Autoloader.js // @updateURL https://raw.githubusercontent.com/TeaWithLucas/Herosaver/master/Autoloader.js @@ -28,19 +28,16 @@ (function(){ - //object constructor - function example(){ - - // run the Herosaver Script - var xhr=new XMLHttpRequest;xhr.open("get","https://raw.githubusercontent.com/TeaWithLucas/Herosaver/master/herosaver.js",true);xhr.onreadystatechange=function(){if(xhr.readyState==4){var script=document.createElement("script");script.type="text/javascript";script.text=xhr.responseText;document.body.appendChild(script)}};xhr.send(null); - - }; + //object constructor + function runinsert(){ + + // run the Herosaver Script + var xhr=new XMLHttpRequest;xhr.open("get","https://raw.githubusercontent.com/TeaWithLucas/Herosaver/master/herosaver.js",true);xhr.onreadystatechange=function(){if(xhr.readyState==4){var script=document.createElement("script");script.type="text/javascript";script.text=xhr.responseText;document.body.appendChild(script)}};xhr.send(null); + + }; - //Wait for page load - window.addEventListener('load', function() { - //instantiate and run - var example = new example(); - }, false); + //instantiate and run + var runinsert = new runinsert(); })();