Greasy Fork

GM_addStyle_shim

This is just a shim to add back in GM_addStyle for scripts in @grant none mode, or that run on benighted engines without native GM_addStyle support.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/44560/271595/GM_addStyle_shim.js

function GM_addStyle (cssStr) {
    var D               = document;
    var newNode         = D.createElement ('style');
    newNode.textContent = cssStr;

    var targ    = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
    targ.appendChild (newNode);
}