From: Visuwesh <visuweshm@gmail.com>
To: 57796@debbugs.gnu.org
Subject: bug#57796: 29.0.50; textsec-link-suspicious-p is unaware of eww-url-transformers
Date: Wed, 14 Sep 2022 19:18:51 +0530 [thread overview]
Message-ID: <87wna6kqws.fsf@gmail.com> (raw)
In-Reply-To: <87tu5a1iu0.fsf@gmail.com> (Visuwesh's message of "Wed, 14 Sep 2022 13:35:59 +0530")
[புதன் செப்டம்பர் 14, 2022] Visuwesh wrote:
> Upon digging this issue further, I see the problem is with shr-tag-a,
> not textsec-link-suspicious-p. Sorry for the misleading bug title---I'm
> not sure what the right way to rename the title is.
Looks like eww uses a custom tag function for <a></a>. I tried the
following patch but I cannot figure out how to turn `href' into a full
URL.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 6ed0719eca..de4a06dc47 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -781,9 +781,13 @@ eww-tag-link
(defun eww-tag-a (dom)
(eww-handle-link dom)
- (let ((start (point)))
+ (let ((start (point))
+ (href (dom-attr dom 'href)))
+ (when href
+ (setq href (eww--transform-url (shr-expand-url href)))
+ (dom-set-attribute dom 'href href))
(shr-tag-a dom)
- (if (dom-attr dom 'href)
+ (if href
(put-text-property start (point)
'keymap
(if (mm-images-in-region-p start (point))
next prev parent reply other threads:[~2022-09-14 13:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 7:41 bug#57796: 29.0.50; textsec-link-suspicious-p is unaware of eww-url-transformers Visuwesh
2022-09-14 8:05 ` Visuwesh
2022-09-14 8:05 ` Visuwesh
2022-09-14 13:48 ` Visuwesh [this message]
2022-09-14 13:17 ` Lars Ingebrigtsen
2022-09-14 14:40 ` Visuwesh
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://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wna6kqws.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=57796@debbugs.gnu.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://git.savannah.gnu.org/cgit/emacs.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).