aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules
diff options
context:
space:
mode:
authorbard <[email protected]>2024-03-11 07:15:07 -0400
committerbard <[email protected]>2024-03-11 07:15:07 -0400
commit330cab74d22e4f4c2714c9249adedce69c478433 (patch)
tree263b98c2d3d71b6f93dbd9ea5fe2d0d8762e8ec7 /bard-emacs-modules
parent168f6bfcde1909cd77047a2b2237e19517dc7d4b (diff)
browse-url-librewolf
Diffstat (limited to 'bard-emacs-modules')
-rw-r--r--bard-emacs-modules/bard-emacs-web.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/bard-emacs-modules/bard-emacs-web.el b/bard-emacs-modules/bard-emacs-web.el
index e095a2d..5547081 100644
--- a/bard-emacs-modules/bard-emacs-web.el
+++ b/bard-emacs-modules/bard-emacs-web.el
@@ -17,3 +17,28 @@
"\\`\\(video/\\|audio\\)")
(global-set-key (kbd "C-c w") 'eww)
+
+;; librewolf open browser
+
+(defun browse-url-librewolf (url &optional new-window)
+ "Ask the Librewolf WWW browser to load URL.
+Defaults to the URL around or before point. Passes the strings
+in the variable `browse-url-librewolf-arguments' to Librewolf.
+
+Interactively, if the variable `browse-url-new-window-flag' is non-nil,
+loads the document in a new Librewolf window. A non-nil prefix argument
+reverses the effect of `browse-url-new-window-flag'.
+
+If `browse-url-librewolf-new-window-is-tab' is non-nil, then
+whenever a document would otherwise be loaded in a new window, it
+is loaded in a new tab in an existing window instead.
+
+Non-interactively, this uses the optional second argument NEW-WINDOW
+instead of `browse-url-new-window-flag'."
+ (interactive (browse-url-interactive-arg "URL: "))
+ (setq url (browse-url-encode-url url))
+ (let* ((process-environment (browse-url-process-environment)))
+ (apply #'start-process
+ (concat "librewolf " url) nil
+ "librewolf"
+ (list url))))