微博外链 APP 自动跳转

渣浪微博外链(t.cn)

// ==UserScript==
// @name 微博外链 APP 自动跳转
// @namespace https://github.com/fython
// @version 0.1
// @description 渣浪微博外链(t.cn)
// @author WSAT
// @match https://m.weibo.cn/feature/*
// @license  MIT
// @grant none
// ==/UserScript==

(function() {
    'use strict';


    function getQueryVariable(str,variable)
    {
        var query = str;
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] == variable &&  pair[1].indexOf("weibo") < 0){
                return pair[1];
            }
        }
        return(false);
    }
    let url = window.location.href;
    url =decodeURIComponent(decodeURIComponent(decodeURIComponent(decodeURIComponent(url))));
    url = getQueryVariable(url,"url");
    window.location.href = url;
})();