From anonymous, 6 Months ago, written in Python.
Embed
  1. # ~/.config/qutebrowser/config.py
  2.  
  3. from qutebrowser.api import interceptor
  4.  
  5. config.load_autoconfig(False)
  6.  
  7. @interceptor.register
  8. def rewrite(request: interceptor.Request): # https://github.com/qutebrowser/qutebrowser/issues/5970
  9.     host = request.request_url.host()
  10.     if host == 'twitter.com' or host == 'www.twitter.com':
  11.         request.request_url.setHost('nitter.net')
  12.         try:
  13.             request.redirect(request.request_url) # <-- This redirect doesn't work
  14.         except Exception:
  15.             pass
  16.  
  17.  
  18. c.bindings.commands = {"normal": {",M": "hint links spawn --detach mpv {hint-url}", ",d": "spawn --userscript dict.cc", ",l": "spawn st -e youtube-dl {url}", ",m": "spawn --detach mpv {url}", ",tw": "spawn --userscript 2nitter.sh", ",wb": "spawn --userscript web.archive", ",yt": "spawn --userscript 2invidious.sh", "si": "hint images download"}}
  19. c.content.autoplay = False
  20. c.content.blocking.hosts.lists = ["https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts", "file:///home/myuser/.config/qutebrowser/blocked-hosts"]
  21. c.content.blocking.method = "both"
  22. c.content.canvas_reading = False
  23. c.content.desktop_capture = False
  24. c.content.geolocation = False
  25. c.content.headers.accept_language = "en-US,en;q=0.5"
  26. c.content.headers.custom = {"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}
  27. c.content.headers.user_agent = "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0"
  28. c.content.media.audio_capture = False
  29. c.content.media.audio_video_capture = False
  30. c.content.media.video_capture = False
  31. c.content.notifications = False
  32. c.content.webgl = False
  33. c.content.webrtc_ip_handling_policy = "disable-non-proxied-udp"
  34. c.editor.command = ["st", "-e", "nvim", "{file}"]
  35. c.url.default_page = "file:///home/myuser/.config/qutebrowser/start_page.html"
  36. c.url.searchengines = {"DEFAULT": "https://searx.lukesmith.xyz/search?q={}", "aw": "https://wiki.archlinux.org/?search={}", "ddg": "https://duckduckgo.com/?q={}", "fd": "https://search.f-droid.org/?q={}&lang=ru", "gh": "https://github.com/search?q={}", "reddit": "https://teddit.net/r/all/search?q={}", "sxpt": "https://search.privacytools.io/searx/?q={}", "sxtc": "https://searx.tuxcloud.net/search?q={}", "ya": "https://yandex.ru/search/?text={}"}
  37. c.url.start_pages = "file:///home/myuser/.config/qutebrowser/start_page.html"