From edbb327ee6ac2451ffa16a9f0823d0e176ef6941 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 13 Feb 2022 19:03:22 +0300 Subject: [PATCH] fixed a typo #28 --- src/assets/javascripts/helpers/instagram.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/assets/javascripts/helpers/instagram.js b/src/assets/javascripts/helpers/instagram.js index 6d57cd5..890e0ef 100644 --- a/src/assets/javascripts/helpers/instagram.js +++ b/src/assets/javascripts/helpers/instagram.js @@ -104,14 +104,22 @@ function redirect(url, initiator, type) { if (initiator && (instancesList.includes(initiator.origin) || targets.includes(initiator.host))) return null; + + // Do not redirect /accounts, /embeds.js, or anything other than main_frame if (type !== "main_frame" || url.pathname.match(bypassPaths)) return 'CANCEL'; - if (url.pathname === "/" || instagramReservedPaths.includes(url.pathname.split("/")[1])) + console.log("Hello", url.href) + + if (url.pathname === "/" || reservedPaths.includes(url.pathname.split("/")[1])) { + console.log("wewe") return `${randomInstance}${url.pathname}${url.search}`; - else - return `${randomInstance}/u${url.pathname}${url.search}`; // Likely a user profile, redirect to '/u/...' + } + else { + console.log("A user profile") + return `${randomInstance}/u${url.pathname}${url.search}`; + } // Likely a user profile, redirect to '/u/...' } function isInstagram(url) {