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:
parent
0799b93000
commit
397fd8cffb
|
@ -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}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue