Greasy Fork

Greasy Fork is available in English.

知乎简书微博外链不停转

try to take over the world!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         知乎简书微博外链不停转
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  try to take over the world!
// @author       a3VjZWNl
// @match        https://link.zhihu.com/?target=*
// @match        https://www.jianshu.com/go-wild?*
// @match        http://t.cn/*
// @grant        none
// @license      GPL-3.0
// ==/UserScript==

(function() {
    'use strict';
    let href = window.location.href
    if (href.indexOf('https://link.zhihu.com/?target=') != -1) {
        // close zhihu login page when not logged
        window.onload = () => {
            let btn = document.querySelector('a.button')
            if (btn) btn.click()
            return
        }
    }
    if (href.indexOf('https://www.jianshu.com/go-wild?') != -1) {
        // close zhihu login page when not logged
        window.onload = () => {
            window.location.href = document.querySelector("textarea").value;
        }
    }
    if (href.indexOf('http://t.cn/') != -1) {
        // close zhihu login page when not logged
        window.onload = () => {
            window.location.href = document.querySelector("p.link").innerText;
        }
    }
    //QQ邮箱不进行匹配为了安全
})();