[epiphany/gnome-41] Display PDFs from non-HTTP/HTTPS protocols
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-41] Display PDFs from non-HTTP/HTTPS protocols
- Date: Sun, 24 Oct 2021 16:38:27 +0000 (UTC)
commit 39006e8fcb4e741861f138d3ac9c5b77bd37fbaf
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Mon Oct 18 14:08:06 2021 -0500
Display PDFs from non-HTTP/HTTPS protocols
We forced PDFs loaded via POST requests to become downloads to solve
issue #1505, but forgot that PDFs can also be opened via other URI
schemes. We shouldn't crash in this case. These can safely be loaded via
PDF.js.
Fixes #1611
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1023>
(cherry picked from commit 0ce5c704dcd1df367998489f3e9b03101978ea6c)
embed/ephy-web-view.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index f4c32551f..a16cf5b82 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -959,7 +959,7 @@ decide_policy_cb (WebKitWebView *web_view,
type = EPHY_WEB_VIEW_DOCUMENT_XML;
} else if (strncmp (mime_type, "image/", 6) == 0) {
type = EPHY_WEB_VIEW_DOCUMENT_IMAGE;
- } else if (strcmp (mime_type, "application/pdf") == 0 && strcmp (method, "GET") == 0) {
+ } else if (strcmp (mime_type, "application/pdf") == 0 && (!method || strcmp (method, "GET") == 0)) {
g_autofree char *pdf_uri = NULL;
/* FIXME: figure out how to make PDFs work in iframes. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]