Add old.reddit.com redirector to qute
This commit is contained in:
parent
12187f5da3
commit
80bf73b28b
@ -133,6 +133,20 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
config.pdfjs = True
|
config.pdfjs = True
|
||||||
|
|
||||||
|
# Redirect to old.reddit.com
|
||||||
|
# from: https://www.reddit.com/r/qutebrowser/comments/n90y93/a_simple_script_to_convert_reddit_links_to/
|
||||||
|
import qutebrowser.api.interceptor
|
||||||
|
|
||||||
|
def rewrite(request: qutebrowser.api.interceptor.Request):
|
||||||
|
if request.request_url.host() == 'www.reddit.com':
|
||||||
|
request.request_url.setHost('old.reddit.com')
|
||||||
|
try:
|
||||||
|
request.redirect(request.request_url)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
qutebrowser.api.interceptor.register(rewrite)
|
||||||
'';
|
'';
|
||||||
keyBindings = {
|
keyBindings = {
|
||||||
normal = {
|
normal = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user