From 1883b327068cc3e63aef54e5b110c3d6c1e3e129 Mon Sep 17 00:00:00 2001 From: Lucas <18538046+TeaWithLucas@users.noreply.github.com> Date: Sat, 29 Jun 2019 14:10:11 +0100 Subject: [PATCH] Create Autoloader.js --- Autoloader.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Autoloader.js diff --git a/Autoloader.js b/Autoloader.js new file mode 100644 index 0000000..9e20f7f --- /dev/null +++ b/Autoloader.js @@ -0,0 +1,46 @@ +// ==UserScript== +// @name Herosaver Autoloader +// @author TeaWithLucas +// @namespace https://github.com/TeaWithLucas/Herosaver/ +// @description Autoloader for the Herosaver Script +// @version 1 +// @include *example.org/* +// @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 +// @run-at document-end +// ==/UserScript== + +/* + * This file is a Greasemonkey user script. To install it, you need + * the Firefox plugin "Greasemonkey" (URL: http://greasemonkey.mozdev.org/) + * After you installed the extension, restart Firefox and revisit + * this script. Now you will see a new menu item "Install User Script" + * in your tools menu. + * + * To uninstall this script, go to your "Tools" menu and select + * "Manage User Scripts", then select this script from the list + * and click uninstall :-) + * + * Creative Commons Attribution License (--> or Public Domain) + * http://creativecommons.org/licenses/by/2.5/ +*/ + +(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); + + }; + + //Wait for page load + window.addEventListener('load', function() { + //instantiate and run + var example = new example(); + }, false); + + +})();