Append Script

Easier way to write scripts as dom

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/32816/215508/Append%20Script.js

  1. // ==UserScript==
  2. // @name Append Script
  3. // @version 1.0
  4. // @description Easier way to write scripts as dom
  5. // @author A Meaty Alt
  6. // @match *://*/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. function appendScript(scriptContent){
  13. var script = document.createElement("script");
  14. script.text = scriptContent;
  15. document.getElementsByTagName("body")[0].appendChild(script);
  16. }
  17. appendScript(appendScript.toString());
  18. })();