Skip old reddit redirect for /media paths
old.reddit.com does not serve media URLs, so the redirect breaks
image and video links.

Assisted-by: Claude Opus 4.6 via pi
change nutuklqnlzssqlnsxwqoqztsnusonszu
commit 18296d25e3245b5fc59eb343f840831b8e59c651
author Alpha Chen <alpha@kejadlen.dev>
date
parent prmulwww
diff --git a/.config/glide/glide.ts b/.config/glide/glide.ts
index b2e44b38..11a0779e 100644
--- a/.config/glide/glide.ts
+++ b/.config/glide/glide.ts
@@ -58,9 +58,13 @@ glide.autocmds.create("UrlEnter", { hostname: "mail.google.com" }, async () => {
   });
 });
 
-// new reddit is bad
+// new reddit is bad (but old.reddit.com doesn't serve media paths)
 glide.autocmds.create("UrlEnter", { hostname: "www.reddit.com" }, async () => {
   const url = new URL(glide.ctx.url);
+
+  // old reddit doesn't serve these
+  if (url.pathname.startsWith("/media")) return;
+
   url.hostname = "old.reddit.com";
   await browser.tabs.update({ url: url.toString() });
 });