diff options
author | Thanos Apollo <[email protected]> | 2024-05-31 16:54:17 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-05-31 16:54:17 +0300 |
commit | 56e1feda693a09e03d7b362d3c84c7c9ab27711c (patch) | |
tree | 3d81ddb1a3b8b04a9f3948c9c6c58790f74cb6ad /.config | |
parent | 7f75832066a4e3c8bffa6be6d707c6f2c56eed70 (diff) |
nyxt: Add invidious & redlib handler
Diffstat (limited to '.config')
-rw-r--r-- | .config/nyxt/config.lisp | 30 |
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))))) |