feat: add img prefix for i.redd.it

"i.redd.it/<imgfile>" redirects "libredd.it/<imgfile>".  Make it
redirect to "libredd.it/img/<imgfile>".  Tested only for "libredd.it".
This commit is contained in:
Jason Kim 2021-04-08 22:38:52 -07:00
parent 0799b93000
commit 397fd8cffb
1 changed files with 3 additions and 0 deletions

View File

@ -448,6 +448,9 @@ function redirectReddit(url, initiator, type) {
if (type !== "main_frame" || url.pathname.match(redditBypassPaths)) { if (type !== "main_frame" || url.pathname.match(redditBypassPaths)) {
return null; return null;
} }
if (url.host === "i.redd.it") {
return `${redditInstance}/img${url.pathname}${url.search}`;
}
return `${redditInstance}${url.pathname}${url.search}`; return `${redditInstance}${url.pathname}${url.search}`;
} }