linonetwo / pc 微信跳转页面直接打开

// ==UserScript==
// @name        pc 微信跳转页面直接打开
// @namespace   https://greasyfork.org/zh-CN
// @version     2020.03.22
// @author      wangruijie
// @modify      LinOnetwo
// @description pc上从微信打开taobao等页面 还要手动复制粘贴,表示不爽
// @include     https://support.weixin.qq.com/cgi-bin/mmsupport-bin/readtemplate*
// @include     https://weixin110.qq.com/cgi-bin/mmspamsupport-bin/*
// @grant       none
// @license MIT
// ==/UserScript==
(function run () {
    // 淘宝链接跳转
    const url1 = 'https://support.weixin.qq.com/cgi-bin/mmsupport-bin';
    const redirectUrl1 = document.querySelector("a.weui-btn.weui-btn_plain-primary").href;
    // 其它链接跳转
    const url2 = 'https://weixin110.qq.com/cgi-bin/mmspamsupport-bin';
    const redirectUrl2 = document.querySelector("a.weui-btn.weui-btn_plain-primary").href;
    const uri = window.location.href;
    if (0 == uri.indexOf(url1)) {
        window.location.href = redirectUrl1;
    } else {
        window.location.href = redirectUrl2;
    }
})();