link(href)
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/25098/159755/curlfunctionjs.js
function curl(url, method, data, success){
GM_xmlhttpRequest({
url: url,
method: method,
data: data,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
onload: success
});
}
function userStyle(css){
var node = document.createElement('style'),
heads = document.getElementsByTagName('head');
node.type = 'text/css';
node.appendChild( document.createTextNode(css) );
if (heads.length > 0)
heads[0].appendChild(node);
else
document.documentElement.appendChild(node);
}
function link(href){
curl(href, 'GET', null, function(response){
userStyle(response.responseText);
});
}