From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#74218: [PATCH] Ask confirmation before sending region to search engine. Date: Wed, 6 Nov 2024 17:51:22 -0800 Message-ID: References: <20241106005544.26516-1-me@fabionatali.com> <86pln8sfqe.fsf@gnu.org> <87ikt0gz7b.fsf@fabionatali.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40650"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74218@debbugs.gnu.org To: Fabio Natali , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 07 02:53:32 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t8riF-000ASY-P0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Nov 2024 02:53:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8rho-0001td-Ff; Wed, 06 Nov 2024 20:53:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8rhm-0001tM-Fg for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 20:53:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8rhm-0001jL-6f for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 20:53:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=jRggsLe0aDjkornMi5li3nQfQiybXIUqpJMyEJqfweI=; b=O5zeHtm9DzBit9ptrdVlrpbc20p6Wbjb2lrjKRvsAjAyEHnLM7chN63CTj9MDEwnOIXtCuoJx9an05h8Xw9seBBRaZV75aQws+dOD15EPcudCKqNCcIJnubXPBvWPIrCflZAfi1W4ojesrGo7K2yIAkw9zArkcN/tFgPxVvdufF6fJ17BV2jNrf/ZqCfn17yMbdwCK2Z7jrvfyN3t8wHbzLBnsUNf5AQQkoJr2btA2PUlGQlz8bjNlvs4lWC58b/2/0Fzt4fMKYusuoPpZQ4kcjPPRkFbY641WmMisk/IHF92ZRXiJOiO115C6ayCQ5TUwFNWdgcBkHfH0ggoWXwzw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8rhm-0002mS-0a for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 20:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Nov 2024 01:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74218-submit@debbugs.gnu.org id=B74218.173094435210651 (code B ref 74218); Thu, 07 Nov 2024 01:53:01 +0000 Original-Received: (at 74218) by debbugs.gnu.org; 7 Nov 2024 01:52:32 +0000 Original-Received: from localhost ([127.0.0.1]:46643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8rhH-0002lj-Ls for submit@debbugs.gnu.org; Wed, 06 Nov 2024 20:52:32 -0500 Original-Received: from mail-ej1-f50.google.com ([209.85.218.50]:46391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8rhE-0002lV-C8 for 74218@debbugs.gnu.org; Wed, 06 Nov 2024 20:52:29 -0500 Original-Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a9e44654ae3so52622666b.1 for <74218@debbugs.gnu.org>; Wed, 06 Nov 2024 17:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730944283; x=1731549083; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=jRggsLe0aDjkornMi5li3nQfQiybXIUqpJMyEJqfweI=; b=HF4f++ZTgtazMJyUUSwProystfBMRlmjSY3ek/HFx+gzq/L+UV/jltcQDA5LY4ZLI/ qc2TmF0laQBLPvDUmgSOMZG5696V8CWOfJUFFeW5Ahgb2glqIB8GBGB5kIFZp9Uk2gWL H9V8nPvkHDLetHaUAWlR4z34Lb+cenrzts/phvr9dYqBYz7JlBvegG6UGKSAgte9ZJ3U vDKFNKd0Tl9W7Z66oL+ef0MIz+fFoeyMMD4bh+Osn0MZS+2SdH3pvxd03gjGyc3GflNo aNOJXmmzBmtoHb5o0T/ICmwScuq+Mx/QXJ9Xw6Purfp0O1mf3MngYK3cjxEUnWk9oN4n 0fOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730944283; x=1731549083; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jRggsLe0aDjkornMi5li3nQfQiybXIUqpJMyEJqfweI=; b=sJAOpHU0bIh2Dj7DRLFhsI5FTBGZCY35BRY2dZklGriR85UuZ+P5fOBzOLbem13SVu 2+7//T3vCx549pHdydukWiMDIfNv6EejftApiJLEWSXEemD1X1+X6DJxlPNPsGfD4fE1 PyUX4iaRc57RmAKCjreEGKV0kbrueG2rwajKUU45wdf2w6g77ThtCfA788j03f6qZPhl tFkG6cpgtycZdHy/H5XVvYAwHaOszuO+h3EAydmwUJ+5FnXcsP184SD9XlvwP6XWImVe lngMDNmJxoaqoSm+cTYyAB6vHYZhGQH0Pb/F5/o0cegmn5hHHM1fh+uC2SVApCrH5uDa yfaA== X-Gm-Message-State: AOJu0YzxvltJWkw4ZgSmLjb02nSVS4WQTcCddw75JfR2n5BmSNDeKGU1 1uToKuhW2EeK8A6yYY5lvx+fNyOXKVRYu0/cHxsNQfd27O2zNbJoStqucIRlhHhMEkEVz+zQ99u H1bqKS9/hY4UkmL91wpqMjoa+SYQ= X-Google-Smtp-Source: AGHT+IGGO+jvjEDpOp4qQzIQGOMVx0kFPvo7jV6iqyA3ATqiGBjUXnKv8hgbwSePdNDn1SdADRHvZIlyWpI4DxOxu94= X-Received: by 2002:a17:907:7f03:b0:a9a:3cf:cdb8 with SMTP id a640c23a62f3a-a9ee2376f91mr20220966b.36.1730944282656; Wed, 06 Nov 2024 17:51:22 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 6 Nov 2024 17:51:22 -0800 In-Reply-To: <87ikt0gz7b.fsf@fabionatali.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294985 Archived-At: Fabio Natali via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > From cdd17053befac8298a04d0cdfc4cafe5a410166b Mon Sep 17 00:00:00 2001 > From: Fabio Natali > Date: Tue, 5 Nov 2024 23:52:30 +0000 > Subject: [PATCH v2] Ask confirmation before sending region to search engine > > With 'eww-search-words' (by default bound to 'M-s M-w') a user > can type in some search terms and get back the results of a web > search from a predefined search engine. If a region is selected, > 'eww-search-words' will use that for the web search instead of > prompting the user. > > In its current form, 'eww-search-words' presents a security and > usability problem. It is relatively too easy to mistakenly > launch the function and, if a region of text is selected, have > potentially sensitive data sent out to a third-party service. > > This commit changes the search function's default behaviour so > that explicit confirmation is required before a region is sent > to a search engine. The behaviour can be adjusted via the > newly-introduced 'eww-search-confirm-send-region' variable, > which is set to true by default. This is a good addition, thanks. I think it should be announced in etc/NEWS, too. > * lisp/net/eww.el (eww-search-confirm-send-region): Add. > (eww-search-words): Update default 'eww-search-words' behaviour > so as to ask confirmation before sending a region to a search > engine. > --- > lisp/net/eww.el | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/lisp/net/eww.el b/lisp/net/eww.el > index 2d351dff88f..cbf989f4a6a 100644 > --- a/lisp/net/eww.el > +++ b/lisp/net/eww.el > @@ -52,6 +52,17 @@ > :group 'eww > :type 'string) > > +(defcustom eww-search-confirm-send-region t > + "Whether to confirm before sending a region to a search engine. We avoid the word "Whether" in the beginning of the docstring of a defcustom, since it doesn't make clear which value means what. So this should read something like: If non-nil, prompt before sending region to a search engine. > +Non-nil if EWW should ask confirmation before sending the > +selected region to the configured search engine. This is the > +default to mitigate the risk of accidental data leak. Set this > +variable to nil to send the region to the search engine > +straightaway." I suggest reformulating this like so: This user option mitigates the risk of accidental data leak. Set this variable to nil to send the region to a search engine without prompting. Note that the first sentence in that paragraph now just repeats the first line, and so can be removed.