Better setup secondary-browser urls
This commit is contained in:
parent
de667256b0
commit
a5d0c182a5
21
init.el
21
init.el
|
@ -121,22 +121,10 @@
|
||||||
#'+browse-url-with-mpv
|
#'+browse-url-with-mpv
|
||||||
browse-url-secondary-browser-function)
|
browse-url-secondary-browser-function)
|
||||||
args)))
|
args)))
|
||||||
(cons (rx ; non-eww-friendly websites
|
(cons (lambda (url) ; non-eww-friendly websites
|
||||||
(or
|
(cl-member url +browse-url-secondary-browser-regexps
|
||||||
"github.com"
|
:test 'string-match-p))
|
||||||
"gitlab.com"
|
#'browse-url-secondary-browser-function)))
|
||||||
"google.com"
|
|
||||||
"imgur.com"
|
|
||||||
"pixelfed" "instagram.com" "bibliogram.art"
|
|
||||||
"reddit.com" "teddit.net"
|
|
||||||
"tildes.net"
|
|
||||||
"taskiq"
|
|
||||||
"twitter.com" "nitter.net"
|
|
||||||
"streamable.com"
|
|
||||||
))
|
|
||||||
browse-url-secondary-browser-function)
|
|
||||||
(cons "." ; everything else
|
|
||||||
#'eww-browse-url)))
|
|
||||||
;; Transform URLs before passing to `browse-url'
|
;; Transform URLs before passing to `browse-url'
|
||||||
(:option +browse-url-transformations `((,(rx "//" (or "youtube.com"
|
(:option +browse-url-transformations `((,(rx "//" (or "youtube.com"
|
||||||
"youtu.be"))
|
"youtu.be"))
|
||||||
|
@ -157,7 +145,6 @@
|
||||||
(:option calendar-location-name _location-name
|
(:option calendar-location-name _location-name
|
||||||
calendar-latitude _location-latitude
|
calendar-latitude _location-latitude
|
||||||
calendar-longitude _location-longitude))
|
calendar-longitude _location-longitude))
|
||||||
|
|
||||||
(setup compile
|
(setup compile
|
||||||
(:option compilation-always-kill t
|
(:option compilation-always-kill t
|
||||||
compilation-ask-about-save nil
|
compilation-ask-about-save nil
|
||||||
|
|
|
@ -63,6 +63,17 @@ named NAME, defaulting to \"+browse-url-with-VIEWER\", and the variable
|
||||||
"Image URL: "
|
"Image URL: "
|
||||||
:name "+browse-image-with-mpv")
|
:name "+browse-image-with-mpv")
|
||||||
|
|
||||||
|
;;; Easily add extra domains to open in `browse-url-secondary-browser-function'
|
||||||
|
;; I like to open most websites in eww, but a lot of website on the modern web
|
||||||
|
;; just make that hard to do. Right now I have a list in `browse-url-handlers'
|
||||||
|
;; with domains in an (rx (or ...)) form, but that's not super easy to config.
|
||||||
|
;; With this custom setting, I'm making it a list that'll be way easier to
|
||||||
|
;; customize.
|
||||||
|
|
||||||
|
(defcustom +browse-url-secondary-browser-regexps nil
|
||||||
|
"List of URL regexps to open with `browse-url-secondary-browser-function'."
|
||||||
|
:type '(repeat regexp))
|
||||||
|
|
||||||
;;; URL Transformation Functions
|
;;; URL Transformation Functions
|
||||||
;; There's a lot of bad websites out there. Luckily we can easily redirect
|
;; There's a lot of bad websites out there. Luckily we can easily redirect
|
||||||
;; requests to more privacy-respecting, or just less javascript-ridden, sites
|
;; requests to more privacy-respecting, or just less javascript-ridden, sites
|
||||||
|
|
Loading…
Reference in New Issue