From 212da72c8e6ff5d7fb3a361922d3b830ce230fb8 Mon Sep 17 00:00:00 2001 From: Opal Date: Tue, 10 Jun 2025 18:25:53 -0700 Subject: [PATCH 1/2] fixed redirects --- .config/doom/config.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.config/doom/config.el b/.config/doom/config.el index 49d61b8..cecfdfe 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -257,9 +257,18 @@ (set-popup-rule! "^\\*osm\\*" :ignore t)) ;; eww -(defun opal/eww-reddit-redirect(url) - "Redirect reddit.com to custom URL." - (replace-regexp-in-string "https://www.reddit.com" "https://eddrit.com" url)) +;; eww +(defun opal/eww-reddit-redirect (url) + "Redirect reddit.com (with or without www) to a privacy frontend." + (replace-regexp-in-string "^https://\\(www\\.\\)?reddit\\.com" "https://eddrit.com" url)) + +(defun opal/eww-x-redirect (url) + "Redirect x.com (with or without www) to a privacy frontend." + (replace-regexp-in-string "^https://\\(www\\.\\)?x\\.com" "https://xcancel.com" url)) + +(defun opal/eww-twitter-redirect (url) + "Redirect twitter.com (with or without www) to a privacy frontend." + (replace-regexp-in-string "^https://\\(www\\.\\)?twitter\\.com" "https://xcancel.com" url)) (global-set-key (kbd "C-c w") #'eww) (global-set-key (kbd "C-c f") #'elfeed-goodies/show-link-hint) @@ -275,7 +284,11 @@ (setq reddit-proxy "https://eddrit.com") ;; Redirect reddit links to privacy respecting frontends. - (setq eww-url-transformers '(eww-remove-tracking opal/eww-reddit-redirect)) + (setq eww-url-transformers + '(eww-remove-tracking + opal/eww-reddit-redirect + opal/eww-twitter-redirect + opal/eww-x-redirect)) ;; Make sure eww opens in it's own buffer (after! eww From 73dc064dc50e78ebf167f7ce9646995122a8d981 Mon Sep 17 00:00:00 2001 From: Opal Date: Tue, 10 Jun 2025 18:26:44 -0700 Subject: [PATCH 2/2] boop --- .config/doom/config.el | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/doom/config.el b/.config/doom/config.el index cecfdfe..4b51ebb 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -256,7 +256,6 @@ (after! osm (set-popup-rule! "^\\*osm\\*" :ignore t)) -;; eww ;; eww (defun opal/eww-reddit-redirect (url) "Redirect reddit.com (with or without www) to a privacy frontend."