Open the F**king URL Right Now

自动跳转某些网站不希望用户直达的外链

Από την 08/10/2020. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name           Open the F**king URL Right Now
// @description    自动跳转某些网站不希望用户直达的外链
// @author         OldPanda
// @match          http://t.cn/*
// @match          https://www.jianshu.com/go-wild?*
// @match          https://link.zhihu.com/?target=*
// @match          https://www.douban.com/link2/?url=*
// @version        0.2.0
// @run-at         document-idle
// @namespace      https://old-panda.com/
// @require        https://code.jquery.com/jquery-3.5.1.min.js
// @license        GPL License
// ==/UserScript==

$(document).ready(function () {
    if (window.location.href.indexOf("http://t.cn/") != -1) {
        if ($(".wrap .desc").first().text() === "如需浏览,请长按网址复制后使用浏览器访问") {
            window.location.replace($(".wrap .link").first().text());
        }
    } else if (window.location.href.indexOf("https://www.jianshu.com/go-wild?") != -1) {
        let fakeUrl = new URL(window.location.href);
        let trueUrl = fakeUrl.searchParams.get("url");
        window.location.replace(trueUrl);
    } else if (window.location.href.indexOf("https://link.zhihu.com/?target=") != -1) {
        window.location.replace($(".content .link").first().text());
    } else if (window.location.href.indexOf("https://www.douban.com/link2/?url=") != -1) {
        let fakeUrl = new URL(window.location.href);
        let trueUrl = fakeUrl.searchParams.get("url");
        window.location.replace(trueUrl);
    }
});