FT to RemovePaywall

Auto-redirect FT article pages to removepaywall.com

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         FT to RemovePaywall
// @namespace    Violentmonkey Scripts
// @version      1.0
// @description  Auto-redirect FT article pages to removepaywall.com
// @author       DionysusDK
// @match        *://*.ft.com/content/*
// @grant        none
// ==/UserScript==

const REMOVE_PAYWALL_URL = "https://removepaywall.com/search?url=";

(function redirectFTArticle() {
    const { hostname, pathname, href } = window.location;

    // Only run on ft.com and only when path is /content/{uuid}
    if (hostname.endsWith("ft.com")) {
        const uuidRegex = /^\/content\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
        if (uuidRegex.test(pathname)) {
            const redirectUrl = `${REMOVE_PAYWALL_URL}${encodeURIComponent(href)}`;
            window.location.href = redirectUrl;
        }
    }
})();

//this was made in one night - If you see that any changes could be made to further the codes simplicity or add more feature - kindly dm u/lonelyportrait123