Greasy Fork is available in English.

Append Script

Easier way to write scripts as dom

Detta skript bör inte installeras direkt. Det är ett bibliotek för andra skript att inkludera med meta-direktivet // @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. })();