From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Sebasti=C3=A1n_?= =?UTF-8?Q?Mon=C3=ADa?= Newsgroups: gmane.emacs.bugs Subject: bug#73133: 29.2; EWW fails to render some webpages Date: Mon, 30 Sep 2024 13:10:59 -0400 Message-ID: References: <86plox4bef.fsf@gnu.org> <7eb7b048-06ea-5751-56e1-590689c8c318@gmail.com> <8e285069-6e95-de49-dd46-92ce49b94372@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30719"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 73133@debbugs.gnu.org, ganimard@tuta.io To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 30 19:11:45 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 1svJw0-0007mj-9p for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 30 Sep 2024 19:11:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svJvn-0001YF-NX; Mon, 30 Sep 2024 13:11:31 -0400 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 1svJvl-0001Ov-A0 for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:11:29 -0400 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 1svJvk-0001dj-V1 for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:11:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=2olBm+uZc5Gsuxh2tUDFFQaGixBi3amufHRF1OXTz1Y=; b=kSv6BasfV1HKzqVbX/KP/W5tg50og5ZMkPKnVNnYzxb3J1s0JVUOOHsO2gQm2Dcd3RFNQI3mgeEGCzytgQ8GAffTTYNGZyilo9RZb1BILJJby/VYMBhVLF/yiSTUdLFrkPVVo2RQTicJey6ym0h074M2AYjVSN0PyzpE9QII51R0aOB58hhXGmweed5eea+13Kvu207UKSSMnJIFUO+pD6Qxepcpbitn/zjFL4SYXur1vMAWTwFLQZxx7c/ifaHt8txZP7zF1ORK9HE/pHwUEFkaykqbAocGM8DUYaJTJHxXzIWadJMjIowdB6LYPhR8zVMnMErju5FcAKD/qQwqWQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svJwH-0007Ck-RT for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 13:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Sebasti=C3=A1n_?= =?UTF-8?Q?Mon=C3=ADa?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 17:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73133 X-GNU-PR-Package: emacs Original-Received: via spool by 73133-submit@debbugs.gnu.org id=B73133.172771630427633 (code B ref 73133); Mon, 30 Sep 2024 17:12:01 +0000 Original-Received: (at 73133) by debbugs.gnu.org; 30 Sep 2024 17:11:44 +0000 Original-Received: from localhost ([127.0.0.1]:45938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svJw0-0007Bc-AW for submit@debbugs.gnu.org; Mon, 30 Sep 2024 13:11:44 -0400 Original-Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]:51243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svJvu-0007BS-EG for 73133@debbugs.gnu.org; Mon, 30 Sep 2024 13:11:42 -0400 Original-Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 55D721140489; Mon, 30 Sep 2024 13:11:00 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 30 Sep 2024 13:11:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sebasmonia.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1727716260; x=1727802660; bh=2olBm+uZc5Gsuxh2tUDFFQaGixBi3amu fHRF1OXTz1Y=; b=nE16A1Mf2mix1SQfejwe/uZ3itc2xaMvh6m74ZPCcqIVgOtD kPmKqONinAgZNFBan6iJxDdP3FipLYymdrrKuA5pMy8705j5gtkVX6seL0tY4XqF cTqsfj+7gi2oyUDXZVu8g91ny95ErWM2P/ff0F7hyYUxB9X0I3WdZWPEOIuRL8YL 7H1tYH9sYj9QQ4AgRO4Ob0jru46EnJAFLAsENdD+k9b4k2PqeWV3CWmu1Thpc3mv w8OjJ5nSEMrj+w2Wgy8wPOF/DR7k6+9fyLvv4soowi81Kd1kE2qHAlI1YGVjvg6d xrND+cxn5yOwYzDCuMPKGOWadndOhXRjokPOnQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727716260; x= 1727802660; bh=2olBm+uZc5Gsuxh2tUDFFQaGixBi3amufHRF1OXTz1Y=; b=J XJa0l9V9+aX/Kltn5zroPdDX5sJJuBTFtAlD8C5Y0kqqSBTcL8q0gx0ajOMf62VC iUK+t9zWnXO++ITgGbg4MJp5RpiW8Af9EF7npcVlHEmclctPhDm6PA6s+i7K7yFh UdJy7+3VkwpsUeaqdDfVP0E7C2lXxbzpIdWscoDwHwOYSIUxpas6QJl3rqVFhOQu BrDx/Mcv/NlMKwzIAT/7VvDBNm6C1opoEdh4DAEyEQMpIEfnAVmByjCDRxJYepPC Kat2LqYkZM+mzqzE7Vcazl+yBTZbtnZ8gpZt07u6qVGCh/UMkF2D9R4FYhm+Xljh g+yndOsRTJnKzKQ33MelQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduhedguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfgfgggtgfesthhqredttder udenucfhrhhomhepufgvsggrshhtihojnhcuofhonhovrgcuoehsvggsrghsthhirghnse hsvggsrghsmhhonhhirgdrtghomheqnecuggftrfgrthhtvghrnhepjeefkeetveeuvdff hedtgeeukedtveekveethfdvgfffieeiieetuefgvdeiveeknecuffhomhgrihhnpehsvg gsrghsmhhonhhirgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehsvggsrghsthhirghnsehsvggsrghsmhhonhhirgdrtghomhdpnh gspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghgrnhhi mhgrrhgusehtuhhtrgdrihhopdhrtghpthhtohepjeefudeffeesuggvsggsuhhgshdrgh hnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehj phhorhhtvghrsghugh X-ME-Proxy: Feedback-ID: iab2c46da:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Sep 2024 13:10:59 -0400 (EDT) In-Reply-To: (Jim Porter's message of "Wed, 25 Sep 2024 18:59:18 -0700") 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:292731 Archived-At: Hello! I was looking into this today and considering our options. Jim Porter writes: > On 9/25/2024 1:46 PM, Sebasti=E1n Mon=EDa wrote: >> Jim Porter writes: >>> I was actually thinking something more general, like a defcustom named >>> 'eww-guess-content-type-functions', which would be a list of functions >>> where the first non-nil result is the guessed Content-Type. That way, >>> we could extend this to other content types (for example, maybe we'd >>> want to look for the magic headers for various image formats too; we >>> don't have to do that in this bug). We aren't really guessing the content-type, at least in the scope of my original patch, and probably this bug. We just want to know if the page is HTML to render it, in these snippets (part of eww-render): ;; original cond ((eww-html-p (car content-type)) (eww-display-html (or encode charset) url nil point buffer)) ;; one possible alternative=20 ((or (eww-html-p (car content-type)) ;; alternative mechanism to detect if the page is HTML ;; via , or other tests. ) (eww-display-html (or encode charset) url nil point buffer)) We could instead change 'eww-html-p' to accept the content-type, other headers and buffer. And in that function, as a fallback, call the functions in 'eww-guess-content-type-functions' and return non-nil for HTML. The reason I am suggesting this is that there is no benefit to have a generic mechanism to detect the Content Type, without heavily modifying 'eww-render'. It only matters in the context of deciding whether to render the HTML or displaying it as-is, other cases are handled in eww-render already. Hope that made sense! I can always address Eli's comments in the context of my original patch, too, for a much simpler (and of course, limited) solution. --=20 Sebasti=E1n Mon=EDa https://site.sebasmonia.com/