diff options
author | Jason Kim <git@jasonk.me> | 2021-04-22 22:16:41 -0700 |
---|---|---|
committer | Jason Kim <git@jasonk.me> | 2021-04-22 23:00:08 -0700 |
commit | bb6894cec54f746d76d8209ca25198881cf9d29b (patch) | |
tree | 3bb4ea8f5b1fc7e6c324313bc64c54b786e3760f /src/pages/background/background.js | |
parent | note: explain why redirect is needed for redd.it (diff) | |
download | libredirect-bb6894cec54f746d76d8209ca25198881cf9d29b.zip |
feat: support teddit by adding /comments hint
Redirecting tedd.it links to teddit instances works when the link starts with "/comments". Add "/comments" to the path for teddit.
Diffstat (limited to 'src/pages/background/background.js')
-rw-r--r-- | src/pages/background/background.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pages/background/background.js b/src/pages/background/background.js index 92502dc2..82f65a20 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -484,9 +484,9 @@ function redirectReddit(url, initiator, type) { } } else if (url.host === "redd.it") { if (redditInstance.includes("teddit")) { - // As of 2021-04-22, redirects for teddit on redd.it links don't work: - // they take you to the home page. - return null; + // As of 2021-04-22, redirects for teddit redd.it links don't work out of + // the box. Prefixing the path with "/comments" seems to help. + return `${redditInstance}/comments${url.pathname}${url.search}`; } } return `${redditInstance}${url.pathname}${url.search}`; |