Greasy Fork

Greasy Fork is available in English.

nonstop:去除手动跳转

Nonstop是用于无感跳转到知乎,微博,简书,QQ 邮箱等无法直接跳转的外链,免去手动跳转的烦恼。

当前为 2021-01-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name               nonstop:去除手动跳转
// @name:zh-TW         nonstop:去除手動跳轉
// @namespace    http://greasyfork.icu/en/users/716928-grepreia
// @version      0.1.20
// @description       Nonstop是用于无感跳转到知乎,微博,简书,QQ 邮箱等无法直接跳转的外链,免去手动跳转的烦恼。
// @description:zh-tw Nonstop是用於無感跳轉到知乎,微博,簡書,QQ 郵箱等無法直接跳轉的外鏈,免去手動跳轉的煩惱。
// @author       grepreia
// @match        *://*.zhihu.com/*
// @match        *://*.jianshu.com/*
// @match        *://mail.qq.com/*
// @require            https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js
// @grant              unsafeWindow
// @grant              GM_log
// @grant              GM_addStyle
// @grant              GM_setValue
// @grant              GM_getValue
// @grant              GM_deleteValue
// @grant              GM_listValues
// @grant              GM_addValueChangeListener
// @grant              GM_removeValueChangeListener
// @grant              GM_getResourceText
// @grant              GM_getResourceURL
// @grant              GM_openInTab
// @grant              GM_xmlhttpRequest
// @grant              GM_notification
// @connect            127.0.0.1
// @connect            localhost
// @run-at             document-end
// ==/UserScript==

(function() {
'use strict'
    let href = window.location.href
    if (href.indexOf('www.zhihu.com/question/') != -1) {
        // close zhihu login page when not logged
        window.onload = () => {
            let btn = document.querySelector('.Button.Modal-closeButton.Button--plain')
            if (btn) btn.click()
            return
        }
    }
    // redirect for zhihu, weibo, qqmail sites
    let link = document.querySelector('.link') || document.querySelector('.safety-url')
    let url = link ? link.textContent : ''
    if (url) {
        window.location.href = url
        return
    }
    // redirect for jianshu site
    let getParams = field => {
        let urlObject = new URL(href)
        let res = urlObject.searchParams.get(field)
        return res
    }
    url = getParams('url')
    if (url) window.location.href = url
})();