external-link-auto-jump

auto jump to external link without double check

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name                  external-link-auto-jump
// @name:zh-CN         外链自动跳转
// @namespace    https://github.com/Seven-Steven/tampermonkey-scripts/tree/main/external-link-auto-jump
// @version      1.4.1.1
// @description  auto jump to external link without double check
// @description:zh-CN  外链自动跳转
// @author       Seven-Steven
// @match        *://link.zhihu.com/?target=*
// @match        *://www.oschina.net/action/GoToLink?url=*
// @match        *://link.csdn.net/?target=*
// @match        *://gitee.com/link?target=*
// @match        *://link.juejin.cn/?target=*
// @match        *://mail.qq.com/cgi-bin/readtemplate?*
// @match        *://www.jianshu.com/go-wild?ac=2&url=*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAD1pJREFUeF7tnX+MHGUZx59n71oj3O2d1SIQfwVqIG1vrkeECkEoEQUSIFp/IIaQGA1Ku7PBUgWVSIkaEZHi7h00aIzGUExVELCCSNKCvxAjdGevDRjRqLkYFCg7W37J7bxm9m6lvd7uvDPvzM7M+34vub/2fd73fb7P97PvvDu/mPAHBaBAVwUY2kABKNBdAQACd0CBHgoAENgDCgAQeAAKRFMAK0g03RBliAIAxJBCI81oCgCQaLohyhAFAIghhUaa0RQAINF0Q5QhCgAQQwqNNKMpAECi6YYoQxQAIIYUGmlGUwCARNMNUYYoAEAMKTTSjKYAAImmG6IMUUAZkKHq6nWGaIU0D1LggD292wRBYgGkQIVdJoiFHA9RYItrO9fprgkA0b3CyeanPSQAJFkDmdC71pAAEBMsnHyO2kICQJI3jykjaAkJADHFvv3JUztIAEh/jGPSKFpBAkBMsm7/ctUGEgDSP9OYNpIWkAAQ02zb33xzDwkA6a9hTBwt15AAEBMt2/+ccwsJAOm/WUwdMZeQABBT7ZpO3rmDBICkYxSTR80VJADEZKuml3tuIMkEIB55Z6VXK4zcTYECFSaJaFVCCuUCkswAYsodag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VwpdA4EYdgGQQkEULvmPl0tGZpce2lrSOES1uDiwRM40N9f0K5lAK9d8Jr9QBEanC3I85xDGGqk5xxavqHX2pjisD9AMFMqwAAMlwcTC19BUAIOnXADPIsAIAJMPFwdTSVwCApF8DzCDDCgCQDBcHU0tfAQCSfg0wgwwrAEAyXBxMLX0FAEj6NcAMMqwAAMlwcTC19BUAIOnXADPIsAIAJMPFwdTSVwCApF8DzCDDCgCQDBcHU0tfAQCSfg0wgwwrAEAyXBxMLX0F/gfo0K19yPKB2gAAAABJRU5ErkJggg==
// @grant        none
// @license      MIT
// @supportURL https://github.com/Seven-Steven/tampermonkey-scripts/issues
// ==/UserScript==

(function () {
  'use strict';

  // 获取跳转目标 url
  function getTarget() {
    // 提取 queryParam 字符串
    let search = window.location.search;
    // 获取 http 字符串的 index
    let subIndex = search.indexOf('http');
    // 获取多余的参数的 index
    let surplusIndex = search.indexOf('&', subIndex);
    // 提取跳转目标字符串
    let encodedTarget = surplusIndex === -1 ? search.substring(subIndex) : search.substring(subIndex, surplusIndex);
    // URI 解码
    let target = decodeURIComponent(encodedTarget);
    return target;
  }

  function jump(url) {
    if (!url) {
      return;
    }

    window.location.href = url;
  }

  jump(getTarget());
})();