Introduction
Introduction Statistics Contact Development Disclaimer Help
Add configuration option for PDF-JS-viewer - surf - surf browser, a WebKit base…
git clone git://git.suckless.org/surf
Log
Files
Refs
README
LICENSE
---
commit ca380ccb93dc204a33970c9025ddcc372fabf953
parent 22cc5ceee2bb1e627457bbbdb4b80734bd25f4a4
Author: Quentin Rameau <[email protected]>
Date: Fri, 18 Apr 2025 13:56:14 +0200
Add configuration option for PDF-JS-viewer
Diffstat:
M config.def.h | 1 +
M surf.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/config.def.h b/config.def.h
@@ -34,6 +34,7 @@ static Parameter defconfig[ParameterLast] = {
[KioskMode] = { { .i = 0 }, },
[LoadImages] = { { .i = 1 }, },
[MediaManualPlay] = { { .i = 1 }, },
+ [PDFJSviewer] = { { .i = 1 }, },
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
[RunInFullscreen] = { { .i = 0 }, },
[ScrollBars] = { { .i = 1 }, },
diff --git a/surf.c b/surf.c
@@ -71,6 +71,7 @@ typedef enum {
KioskMode,
LoadImages,
MediaManualPlay,
+ PDFJSviewer,
PreferredLanguages,
RunInFullscreen,
ScrollBars,
@@ -285,6 +286,7 @@ static ParamName loadcommitted[] = {
Inspector,
// KioskMode,
MediaManualPlay,
+ PDFJSviewer,
RunInFullscreen,
ScrollBars,
SiteQuirks,
@@ -817,6 +819,8 @@ setparameter(Client *c, int refresh, ParamName p, const Arg…
webkit_settings_set_media_playback_requires_user_gesture(
c->settings, a->i);
break;
+ case PDFJSviewer:
+ return; /* do nothing */
case PreferredLanguages:
return; /* do nothing */
case RunInFullscreen:
@@ -1701,7 +1705,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://")
+ && !(g_str_has_prefix(uri, "webkit-pdfjs-viewer://") && curconfig[…
&& strlen(uri) > 0) {
for (i = 0; i < strlen(uri); i++) {
if (!g_ascii_isprint(uri[i])) {
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.