Greasy Fork

Greasy Fork is available in English.

消腾讯和飞书链接插入页

自动跳转腾讯链接和飞书链接插入页

当前为 2023-05-24 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        消腾讯和飞书链接插入页
// @namespace   Violentmonkey Scripts
// @match       *://c.pc.qq.com/middlem.html*
// @match       *://c.pc.qq.com/ios.html*
// @match       *://security.feishu.cn/link/safety*
// @grant       none
// @version     1.2
// @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);
    }
})();