unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jinwoo Lee <jinwoo68@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.
Date: Thu, 29 Jan 2015 09:28:47 -0800	[thread overview]
Message-ID: <1422552527-16889-1-git-send-email-jinwoo68@gmail.com> (raw)

It's default value is ".", meaning all remote images will be blocked
by default.
---
 emacs/notmuch-show.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..cc6aca9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-text/html-blocked-images "."
+  "Remote images that have URLs matching this regexp will be blocked."
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,11 @@ will return nil if the CID is unknown or cannot be retrieved."
 	   ;; URL-decode it (see RFC 2392).
 	   (let ((cid (url-unhex-string url)))
 	     (first (notmuch-show--get-cid-content cid)))))
-	;; Block all external images to prevent privacy leaks and
-	;; potential attacks.  FIXME: If we block an image, offer a
-	;; button to load external images.
-	(shr-blocked-images "."))
+	;; By default, block all external images to prevent privacy
+	;; leaks and potential attacks.  FIXME: If we block an image,
+	;; offer a button to load external images.
+	(shr-blocked-images notmuch-show-text/html-blocked-images)
+	(gnus-blocked-images notmuch-show-text/html-blocked-images))
     (shr-insert-document dom)
     t))
 
-- 
2.2.2

             reply	other threads:[~2015-01-29 17:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 17:28 Jinwoo Lee [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-01-29 21:35 [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images Jinwoo Lee
2015-01-31  0:10 ` Jinwoo Lee
2015-02-01 21:36 ` David Edmondson
2015-02-01 21:42   ` Tomi Ollila
2015-02-01 21:45     ` Tomi Ollila
2015-02-01 21:40 ` Tomi Ollila
2015-02-02 18:59   ` Jinwoo Lee
2015-02-02 22:17     ` David Bremner
2015-02-02 18:54 Jinwoo Lee
2015-02-02 20:32 ` Tomi Ollila
2015-02-02 20:41   ` Jinwoo Lee
2015-02-02 21:04     ` Jinwoo Lee
2015-02-02 21:08       ` Jinwoo Lee
2015-02-02 22:15         ` David Bremner
2015-02-02 22:24           ` Jinwoo Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422552527-16889-1-git-send-email-jinwoo68@gmail.com \
    --to=jinwoo68@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).