diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index bedc354..07f7a52 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -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}` } diff --git a/src/config.json b/src/config.json index 3bd300a..7f2071b 100644 --- a/src/config.json +++ b/src/config.json @@ -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(\\/|$)",