自动跳转腾讯链接和飞书链接插入页
// ==UserScript==
// @name 消腾讯和飞书链接插入页
// @namespace Violentmonkey Scripts
// @match *://c.pc.qq.com/middlem.html*
// @match *://c.pc.qq.com/middleb.html*
// @match *://c.pc.qq.com/middlect.html*
// @match *://c.pc.qq.com/ios.html*
// @match *://security.feishu.cn/link/safety*
// @grant none
// @version 1.4
// @author Eric_Lian
// @description 自动跳转腾讯链接和飞书链接插入页
// @icon https://3gimg.qq.com/tele_safe/static/tmp/ic_alert_blue.png
// @license MIT
// @run-at document-start
// ==/UserScript==
(function(){
'use strict';
function getParams(name){
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
function getTarget() {
const hostname = location.hostname;
if (hostname == 'c.pc.qq.com') {
return getParams('pfurl') ?? getParams('url');
} else if (hostname == 'security.feishu.cn' ){
return getParams('target');
}
}
let target = getTarget();
if (target) {
if (target.indexOf(":/") < 0) {
target = "http://" + target;
}
window.location.replace(target);
}
})();