about summary refs log tree commit diff stats
path: root/src/pages/background/background.js
diff options
context:
space:
mode:
authorJason Kim <git@jasonk.me>2021-04-09 00:10:27 -0700
committerJason Kim <git@jasonk.me>2021-04-09 00:16:05 -0700
commit905abce8f778e9a3edbd69b9f3183c93d11edffa (patch)
treee6248a35556dcf70ff7724b2b903cf51c0f2e5a8 /src/pages/background/background.js
parentfix: don't redirect for rest of instances (diff)
downloadlibredirect-905abce8f778e9a3edbd69b9f3183c93d11edffa.zip
refactor: drop teddit image redirect support
No longer redirect image links for teddit instances.  Add a comment
detailing the two issues I found.  Now, the feature should be stable.
Diffstat (limited to 'src/pages/background/background.js')
-rw-r--r--src/pages/background/background.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pages/background/background.js b/src/pages/background/background.js
index 25342794..2047bfbe 100644
--- a/src/pages/background/background.js
+++ b/src/pages/background/background.js
@@ -452,8 +452,12 @@ function redirectReddit(url, initiator, type) {
     if (redditInstance.includes("libredd")) {
       return `${redditInstance}/img${url.pathname}${url.search}`;
     } else if (redditInstance.includes("teddit")) {
-      let pathWithoutSlash = url.pathname.slice(1);
-      return `${redditInstance}/pics/w:null_${pathWithoutSlash}${url.search}`
+      // As of 2021-04-09, redirects for teddit images are nontrivial:
+      // - navigating to the image before ever navigating to its page causes
+      //   404 error (probably needs fix on teddit project)
+      // - some image links on teddit are very different
+      // Therefore, don't support redirecting image links for teddit.
+      return null;
     } else {
       return null;
     }