diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/assets/javascripts/helpers/instagram.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/assets/javascripts/helpers/instagram.js b/src/assets/javascripts/helpers/instagram.js index 6d57cd59..890e0ef3 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) { |