SimpCity Redirect Bypass

Automatically bypasses the "not trusted external site" redirect confirmation page

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         SimpCity Redirect Bypass
// @namespace    
// @license MIT
// @version      1.0
// @description  Automatically bypasses the "not trusted external site" redirect confirmation page
// @match        *://simpcity.cr/redirect/*
// @match        *://simpcity.su/redirect/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Method 1: Parse the destination URL from the page URL's 'to' parameter (fastest, runs at document-start)
    try {
        const params = new URLSearchParams(window.location.search);
        const encodedUrl = params.get('to');
        if (encodedUrl) {
            const destination = atob(encodedUrl);
            if (destination.startsWith('http')) {
                window.location.replace(destination);
                return;
            }
        }
    } catch (e) {
        // Fall through to Method 2
    }

    // Method 2: Fallback - wait for the DOM and click the destination link
    function clickDestination() {
        const link = document.querySelector('.contentRow-main a[href^="http"]') ||
                     document.querySelector('a.link--external[href^="http"]') ||
                     document.querySelector('.p-body-main a[href^="http"]:not([href*="simpcity"])');
        if (link) {
            window.location.replace(link.href);
        }
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', clickDestination);
    } else {
        clickDestination();
    }
})();