// ==UserScript==
// @name TK短网址
// @license MIT
// @namespace http://d.glf2ym.cn/
// @version 1.0.1
// @description 在线缩短网址,方便快捷,跳转速度快,永久有效,可以缩短指定和当前页面链接
// @require https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js
// @require http://code.jquery.com/ui/1.11.0/jquery-ui.min.js
// @author Mr Liu -- liuliangzheng520@163.com
// @include *
// @icon https://cdn.jsdelivr.net/gh/liuliang520500/liuliang520500.github.io@67226ff1610d574603040329c0984671914d6b5e/favicon.ico
// @connect d.glf2ym.cn
// @run-at document-end
// @grant GM_log
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_addStyle
// @downloadURL none
// ==/UserScript==
(function () {
'use strict';
var my = {
key: "",
bd: function (url) {
var head = document.head || document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.setAttribute("src", url);
script.setAttribute("defer", "defer");
head.appendChild(script);
},
getKey: function (link) {
return new Promise((resolve, reject) => {
GM_xmlhttpRequest({
method: "post",
url: 'http://d.glf2ym.cn',
data: JSON.stringify({
"url": link
}),
headers: {
"Content-Type": "application/json"
},
onload: function (r) {
resolve(r);
},
onerror: function (err) {
reject(r);
}
})
})
},
init: function () {
$("body:first").append("