style-shims

Shims for GM_addStyle and GM.addStyle.

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyforks.org/scripts/483122/1304475/style-shims.js

// ==UserScript==
// @name               style-shims
// @description        Shims for GM_addStyle and GM.addStyle.
// @author             Jason Kwok
// @namespace          https://jasonhk.dev/
// @version            1.0.3
// @license            MIT
// ==/UserScript==

let GM_addStyle = function GM_addStyle(css)
{
    const style = document.createElement("style");
    style.setAttribute("type", "text/css");
    style.textContent = css;

    const target = document.head ?? document.documentElement;
    return target.appendChild(style);
}

GM.addStyle = GM_addStyle;
长期地址
遇到问题?请前往 GitHub 提 Issues。