From 4fe6fbbfaf67136a3d28d33fb4caa2ef39311f37 Mon Sep 17 00:00:00 2001 From: Ahmet Arda Kavakci Date: Sun, 13 Mar 2022 18:57:14 +0300 Subject: [PATCH] Fix Instagram profile redirection --- privacy-redirector.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/privacy-redirector.js b/privacy-redirector.js index 671f3fe..8f4db54 100644 --- a/privacy-redirector.js +++ b/privacy-redirector.js @@ -4,7 +4,7 @@ // @downloadURL https://raw.githubusercontent.com/dybdeskarphet/privacy-redirector/main/privacy-redirector.js // @updateURL https://raw.githubusercontent.com/dybdeskarphet/privacy-redirector/main/privacy-redirector.js // @license WTFPL -// @version 1.1.2 +// @version 1.1.3 // @description Redirect social media platforms to their privacy respecting frontends // @description:tr Sosyal medya platformlarını, gizliliğe saygı duyan önyüzlerine yönlendirir // @run-at document-start @@ -37,21 +37,30 @@ let redirect_reddit = true; // // // // // // // // // // // // // function redirectInstagram() { + if (redirect_instagram == false) { return; } - + if (window.location.pathname.indexOf("/p/") == 0) { window.stop(); location.hostname = 'bibliogram.pussthecat.org'; } else if (window.location.pathname == "/") { window.stop(); location.hostname = 'bibliogram.pussthecat.org'; + } else if (window.location.pathname === "/accounts/login/") { + window.stop(); + let oldQuery = window.location.search; + let newQuery = oldQuery.replace("?next=/", "/") + let newURL = window.location.protocol + "//" + "bibliogram.pussthecat.org" + "/u" + newQuery + window.location.hash; + window.location.replace(newURL); } else { + window.stop(); let oldUrlPath = window.location.pathname; let newURL = window.location.protocol + "//" + "bibliogram.pussthecat.org" + "/u" + oldUrlPath + window.location.search + window.location.hash; - window.location.replace (newURL); + window.location.replace(newURL); } + } function redirectTwitter() { @@ -114,3 +123,4 @@ switch (urlHostname) { redirectYoutube(); break; } +