🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

自动跳转QQ劫持的页面

自动跳转 "当前网页非官方页面,请复制后访问" 网页到原地址,修改自作者solstice23的版本。

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         自动跳转QQ劫持的页面
// @namespace    http://tampermonkey.net/
// @version      1
// @description  自动跳转 "当前网页非官方页面,请复制后访问" 网页到原地址,修改自作者solstice23的版本。
// @author       mengshouer
// @match        https://c.pc.qq.com/middlem.html*
// @match        http://c.pc.qq.com/middlem.html*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function getParams(name){
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return decodeURIComponent(r[2].startsWith("http") ? r[2] : `https://${r[2]}`);
        }
        return '';
    }
    function htmlEscape(text){
        return text.replace(/[<>"&]/g, function(match, pos, originalText){
            switch(match){
                case "<": return "&lt;";
                case ">":return "&gt;";
                case "&":return "&amp;";
                case "\"":return "&quot;";
            }
        });
    }
    let url = getParams('pfurl');
    document.body.innerHTML="<style>body{overflow: hidden;}#msg{text-align: center;font-size: 25px;margin-top: 20vh;}#text{font-size: 80%;opacity: .6;margin-bottom: 20px;}</style><div id='msg'><div id='text'>正在跳转到</div>" + htmlEscape(url) + "</div>";
    window.location.replace(url);
})();