summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/nyxt/config.lisp30
1 files changed, 30 insertions, 0 deletions
diff --git a/.config/nyxt/config.lisp b/.config/nyxt/config.lisp
index 4367e12..4b9f4f2 100644
--- a/.config/nyxt/config.lisp
+++ b/.config/nyxt/config.lisp
@@ -51,3 +51,33 @@ Upstream Nyxt doesn't have it because it may break some websites.")
(preferred-user-agent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15"
:doc "Mimic Chrome on MacOS.")))
+
+(defun redlib-handler (request-data)
+ (let ((url (url request-data)))
+ (setf (url request-data)
+ (if (search "reddit.com" (quri.uri:uri-host url))
+ (progn
+ (setf (quri.uri:uri-host url) "redlib.pussthecat.org")
+ (log:info "Switching to old Reddit: ~s"
+ (render-url url))
+ url)
+ url)))
+ request-data)
+
+(defun invidious-handler (request-data)
+ (let ((url (url request-data)))
+ (setf (url request-data)
+ (if (search "youtube.com" (quri.uri:uri-host url))
+ (progn
+ (setf (quri.uri:uri-host url) "yewtu.be")
+ (log:info "Switching to invidious: ~s"
+ (render-url url))
+ url)
+ url)))
+ request-data)
+
+(define-configuration web-buffer
+ ((request-resource-hook
+ (progn
+ (serapeum:add-hook %slot-default% 'redlib-handler)
+ (serapeum:add-hook %slot-default% 'invidious-handler)))))