Userscripts icon indicating copy to clipboard operation
Userscripts copied to clipboard

Create a userscript for rewriting URLs

Open ameshkov opened this issue 10 years ago • 3 comments

Source request: http://forum.adguard.com/showthread.php?8695-HowTo-rewrite-a-URL

ameshkov avatar Jan 19 '16 21:01 ameshkov

Recently, I ran into ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/readme.txt while reading about the recent PHP vuln, but it turns out the major browsers dropped FTP capability around the time they integrated HTTPS-by-default everywhere. If this userscript is ever published, the best fallback would be to convert

  • [ ] [s]ftp[s]:// → https://
  • [ ] ftp:// → http:// (which the browsers would then try https://, but would allow fallback to http:// with (justified) warning

TPS avatar Jun 10 '24 10:06 TPS

In theory the new $urltransform modifier: https://github.com/AdguardTeam/CoreLibs/issues/1364

ameshkov avatar Jun 10 '24 13:06 ameshkov

I've read the $urltransform sections of the docs several times, but regex always confuses me. This seems simple, but I hesitate b/c of that. What would be the correct rule to attempt?

TPS avatar Jun 12 '24 11:06 TPS