From 07e57ebaff1f1851352ba35e9011681c8089619b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Fri, 23 Apr 2021 13:07:50 +0200 Subject: [PATCH] Fix redirection when returning from new website (#5527) --- site_script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site_script.js b/site_script.js index 0864a5c1..7b84772a 100644 --- a/site_script.js +++ b/site_script.js @@ -200,6 +200,7 @@ $hideAlways = document.getElementById('hide-feedback-request'); var redesignUrl = 'https://simple-icons.github.io/simple-icons-website/', + redesignRootDomain = 'simple-icons.github.io', hideBannerAlwaysIdentifier = 'hide-banner', redirectAutomaticallyIdentifier = 'redirect-to-redesign'; @@ -235,7 +236,7 @@ var redirect = localStorage.getItem(redirectAutomaticallyIdentifier); if (redirect === 'true') { $redirectAutomatically.innerHTML = "Disable redirect"; - if (document.referrer !== redesignUrl) { + if (document.referrer.split('/')[2] !== redesignRootDomain) { window.location.replace(redesignUrl); } }