Added support to subdomains for scribe https://github.com/libredirect/libredirect/issues/644
This commit is contained in:
parent
6164c9304c
commit
4ddfca0f74
|
@ -181,6 +181,16 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||
}
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "scribe": {
|
||||
const regex = url.hostname.match(/^(link|cdn-images-\d+|.*)\.medium\.com/)
|
||||
if (regex && regex.length > 1) {
|
||||
const subdomain = regex[1]
|
||||
if (subdomain != "link" || !subdomain.startsWith("cdn-images")) {
|
||||
return `${randomInstance}/@${subdomain}${url.pathname}${url.search}`
|
||||
}
|
||||
}
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "simplyTranslate": {
|
||||
return `${randomInstance}/${url.search}`
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https:\\/{2}(link\\.|cdn\\-images\\-\\d+\\.)?medium\\.com",
|
||||
"^https:\\/{2}(.*\\.)?medium\\.com",
|
||||
"^https?:\\/{2}towardsdatascience\\.com(\\/|$)",
|
||||
"^https?:\\/{2}uxdesign\\.cc(\\/|$)",
|
||||
"^https?:\\/{2}uxplanet\\.org(\\/|$)",
|
||||
|
|
Loading…
Reference in New Issue