From 44d2368ca12b4de8ee67a92cb20a115fe955d819 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 20 Jul 2020 12:21:39 +0200 Subject: [PATCH] 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). --- lisp/xwidget.el | 3 +++ 1 file changed, 3 insertions(+) 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)))) -- 2.39.5