I didn't install Redirector because I didn't want an extra extension and already had Violentmonkey for userscripts. (But it seems Redirector is faster to redirect than Violentmonkey, even when it's set to
In any case, neither Violentmonkey set to
@include /^https?://(?:.*\.)*(?<!link\.)medium\.com(/.*)?$/, nor Redirector set to
^https?://(?:.*\.)*(?<!link\.)medium\.com(/.*)?$, redirect the above site. And looking at Firefox's network inspector with "persist logs" enabled, the page does not redirect me through
I found that global-identity is only triggered on the first visit to a Medium domain (or first refresh after clearing that domain's cookies, by clicking Firefox's Lock ("Site information for blogg.bekk.no") → "Clear cookies and site data"). Subsequent page refreshes, navigating back and clicking on the same link, and clicking on a link to a different page on the same domain don't cause a global-identity redirect. Logging into medium.com on a different tab and refreshing the custom domain triggers global-identity (logging into Medium on the custom domain doesn't). Logging out from the custom domain, or logging out from medium.com and refreshing the custom domain, both triggers global-identity.
In summary, I think the global-identity redirect only occurs on first visit to a custom Medium domain, or when the logged-in state changes. And this isn't reliable enough to redirect all visits to a Medium proxy domain to scribe.rip.
A bookmarklet containing
window.location.replace("https://scribe.rip"+location.pathname+location.search+location.hash)works if you click it manually.
What's the best solution to redirect these pages? Use JS to detect Medium pages using a heuristic? Detect IP addresses like uBlock Origin does (https://github.com/gorhill/uBlock/wiki/Permissions#access-ip-address-and-hostname-information)?