Make xwidget-webkit-browse-url slightly more DWIM

* lisp/xwidget.el (xwidget-webkit-browse-url): Prepend "https" to
URLs that don't have a protocol (bug#31369).
This commit is contained in:
Lars Ingebrigtsen 2020-07-20 12:21:39 +02:00
parent 1da5b3abd5
commit 44d2368ca1

View file

@ -92,6 +92,9 @@ Interactively, URL defaults to the string looking like a url around point."
(or (featurep 'xwidget-internal)
(user-error "Your Emacs was not compiled with xwidgets support"))
(when (stringp url)
;; If it's a "naked url", just try adding https: to it.
(unless (string-match "\\`[A-Za-z]+:" url)
(setq url (concat "https://" url)))
(if new-session
(xwidget-webkit-new-session url)
(xwidget-webkit-goto-url url))))