From: Lars Ingebrigtsen Date: Mon, 20 Jul 2020 10:21:39 +0000 (+0200) Subject: Make xwidget-webkit-browse-url slightly more DWIM X-Git-Tag: emacs-28.0.90~6958 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44d2368ca12b4de8ee67a92cb20a115fe955d819;p=emacs.git 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). --- diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 775dddf8ef6..aed6c09122c 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -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))))