Greasy Fork is available in English.

Redirector

Redirect Instagram to imginn.com and Reddit to redlib.catsearch.com; add ?x=1 or #x to skip redirect

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Redirector
// @namespace    https://example.org/redirects
// @version      1.2
// @description  Redirect Instagram to imginn.com and Reddit to redlib.catsearch.com; add ?x=1 or #x to skip redirect
// @match        *://*.instagram.com/*
// @match        *://instagram.com/*
// @match        *://*.reddit.com/*
// @match        *://reddit.com/*
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  const url = new URL(location.href);
  const bypass = url.searchParams.get('x') === '1' || location.hash.includes('#x') || location.hash === 'x';
  if (bypass) return;

  const redirects = [
    { hosts: ['instagram.com', 'www.instagram.com'], target: 'imginn.com' },
    { hosts: ['reddit.com', 'www.reddit.com'], target: 'redlib.catsarch.com' },
  ];

  const host = location.hostname.toLowerCase();
  for (const r of redirects) {
    if (r.hosts.includes(host) && host !== r.target) {
      const newUrl = location.protocol + '//' + r.target + location.pathname + location.search + location.hash;
      location.replace(newUrl);
      break;
    }
  }
})();