QQ链接直接跳转

跳过垃圾非官方页面的提示

目前為 2021-07-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name         QQ链接直接跳转
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  跳过垃圾非官方页面的提示
// @author       aotmd
// @match        https://c.pc.qq.com/*
// @grant        none
// ==/UserScript==

(function () {
    addLoadEvent(() => {
        window.setTimeout(() => {
            window.location.href=document.querySelector("#url").innerText;
        }, 0);
    });

    addStyle(``);

    /**
     * 添加浏览器执行事件
     * @param func 无参匿名函数
     */
    function addLoadEvent(func) {
        let oldOnload = window.onload;
        if (typeof window.onload != 'function') {
            window.onload = func;
        } else {
            window.onload = function () {
                try {
                    oldOnload();
                } catch (e) {
                    console.log(e);
                } finally {
                    func();
                }
            }
        }
    }

    //添加css样式
    function addStyle(rules) {
        let styleElement = document.createElement('style');
        styleElement["type"] = 'text/css';
        document.getElementsByTagName('head')[0].appendChild(styleElement);
        styleElement.appendChild(document.createTextNode(rules));
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址