Skip to content

* lisp/net/browse-url.el: Add vivaldi support #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions lisp/net/browse-url.el
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,22 @@ Defaults to the value of `browse-url-firefox-arguments' at the time
:version "24.1"
:group 'browse-url)

(defcustom browse-url-vivaldi-program
(let ((candidates '("vivaldi" "vivaldi-stable")))
(while (and candidates (not (executable-find (car candidates))))
(setq candidates (cdr candidates)))
(or (car candidates) "vivaldi"))
"The name by which to invoke Vivaldi."
:type 'string
:version "25.3"
:group 'browse-url)

(defcustom browse-url-vivaldi-arguments nil
"A list of strings to pass to Vivaldi as arguments."
:type '(repeat (string :tag "Argument"))
:version "25.3"
:group 'browse-url)

(defcustom browse-url-galeon-program "galeon"
"The name by which to invoke Galeon."
:type 'string
Expand Down Expand Up @@ -930,6 +946,7 @@ instead of `browse-url-new-window-flag'."
((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
((executable-find browse-url-firefox-program) 'browse-url-firefox)
((executable-find browse-url-chromium-program) 'browse-url-chromium)
((executable-find browse-url-vivaldi-program) 'browse-url-vivaldi)
;;; ((executable-find browse-url-galeon-program) 'browse-url-galeon)
((executable-find browse-url-kde-program) 'browse-url-kde)
;;; ((executable-find browse-url-netscape-program) 'browse-url-netscape)
Expand Down Expand Up @@ -1131,6 +1148,24 @@ The optional argument NEW-WINDOW is not used."
browse-url-chromium-arguments
(list url)))))


(defun browse-url-vivaldi (url &optional _new-window)
"Ask the Vivaldi WWW browser to load URL.
Default to the URL around or before point. The strings in
variable `browse-url-vivaldi-arguments' are also passed to
Vivaldi.
The optional argument NEW-WINDOW is not used."
(interactive (browse-url-interactive-arg "URL: "))
(setq url (browse-url-encode-url url))
(let* ((process-environment (browse-url-process-environment)))
(apply 'start-process
(concat "vivaldi " url) nil
browse-url-vivaldi-program
(append
browse-url-vivaldi-arguments
(list url)))))


(defun browse-url-chrome (url &optional _new-window)
"Ask the Google Chrome WWW browser to load URL.
Default to the URL around or before point. The strings in
Expand Down