[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Forward: Bug#447728: Annoying "leaving secure page" yornp



Hi emacs-w3m developers,

The attached mail is forwarded from Debian bug tracking system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447728

(If possible, please preserve 447728-forwarded@xxxxxxxxxxxxxxx
in replies.)
--- Begin Message ---
Package: w3m-el
Severity: wishlist
Tags: patch

In w3m.el, the W3M-RETRIEVE-AND-RENDER procedure *always* prompts the
user, modally, when transitioning from an https url to a non-https
url.  This is useless and annoying when one enters a URL explicitly
(e.g. w3m-goto-url, w3m-search) -- the user KNOWS that the new URL
isn't using https, because she entered it explicitly.  It is also
annoying when using w3m-view-previous-page -- for example, when
flipping between google search results (using http) and
help.ubuntu.com (using https).

I would like this y-or-n-p to either be smarter about when it asks me,
or to support a customize option that would make it use MESSAGE
instead of Y-OR-N-P.  Attached is an untested patch (hopefully)
implementing the latter.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -ud /home/twb/.emacs.d/lisp/w3m-el/w3m.el /tmp/buffer-content-8004Iye
--- /home/twb/.emacs.d/lisp/w3m-el/w3m.el	2007-10-15 07:57:36.000000000 +1000
+++ /tmp/buffer-content-8004Iye	2007-10-23 22:43:52.499871022 +1000
@@ -5459,6 +5459,13 @@
   (w3m-message "Rendering...done")
   (w3m-rendering-extract-title))
 
+(defcustom w3m-confirm-leaving-secure t
+  "When t, leaving a secure page (HTTPS) will always require
+explicit confirmation.  When nil, doing so will simply cause a
+warning message."
+  :group 'w3m
+  :type 'boolean)
+
 (defun w3m-retrieve-and-render (url &optional no-cache charset
 				    post-data referer handler)
   "Retrieve contents of URL and render them in the current buffer.
@@ -5468,7 +5475,9 @@
 called with t as an argument.  Otherwise, it will be called with nil."
   (unless (and w3m-current-ssl
 	       (not (string-match "\\`\\(?:ht\\|f\\)tps://" url))
-	       (not (y-or-n-p "You are leaving secure page.  Continue? ")))
+	       (not (if w3m-confirm-leaving-secure
+                        (y-or-n-p "You are leaving secure page.  Continue? ")
+                      (message "Leaving secure page..."))))
     (lexical-let ((url (w3m-url-strip-fragment url))
 		  (charset charset)
 		  (page-buffer (current-buffer))

Diff finished.  Tue Oct 23 22:43:52 2007

--- End Message ---