Append Script

Easier way to write scripts as dom

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/32816/215508/Append%20Script.js

// ==UserScript==
// @name         Append Script
// @version      1.0
// @description  Easier way to write scripts as dom
// @author       A Meaty Alt
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function appendScript(scriptContent){
        var script = document.createElement("script");
        script.text = scriptContent;
        document.getElementsByTagName("body")[0].appendChild(script);
    }
    appendScript(appendScript.toString());
})();