On Sat, Sep 14, 2024 at 05:14:19AM +0400, Artyom Bologov wrote:
> This patch allows webkit-pdfjs-viewer:// links, thus enabling WebKit
> built-in PDF viewer. It's a feature that was in WebKitGTK for some time,
> and I've been missing it in Surf. So here you go, a patch adding it.
> 

> To: [email protected]
> From d553d091c7a3a26f3367fda4a2e3e10e76ada588 Mon Sep 17 00:00:00 2001
> From: Artyom Bologov <[email protected]>
> Date: Sat, 14 Sep 2024 04:52:49 +0400
> Subject: [surf][patch] Support PDFs
> 
> ---
>  surf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/surf.c b/surf.c
> index 18d65d7..00f718d 100644
> --- a/surf.c
> +++ b/surf.c
> @@ -1701,6 +1701,7 @@ decideresource(WebKitPolicyDecision *d, Client *c)
>           && !g_str_has_prefix(uri, "webkit://")
>           && !g_str_has_prefix(uri, "data:")
>           && !g_str_has_prefix(uri, "blob:")
> +         && !g_str_has_prefix(uri, "webkit-pdfjs-viewer://")
>           && strlen(uri) > 0) {
>               for (i = 0; i < strlen(uri); i++) {
>                       if (!g_ascii_isprint(uri[i])) {
> -- 
> 2.45.2
> 

> 
> -- 
> Artyom Bologov
> https://aartaka.me


Perhaps this should be disabled by default?

I prefer to use my system PDF viewer.

Also maybe it could have potential security issues with the built-in PDF
viewer(?)

-- 
Kind regards,
Hiltjo

Reply via email to