WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
260019
[WPE][GTK] There should be an easily accessible way to disable pdf.js at runtime
https://bugs.webkit.org/show_bug.cgi?id=260019
Summary
[WPE][GTK] There should be an easily accessible way to disable pdf.js at runtime
Martin Demlon
Reported
2023-08-10 03:33:08 PDT
I prefer my local PDF viewer over pdf.js and would like my browser (in case it matters: luakit) to directly hand through PDFs to it. I have groped around in the Webkit source a bit, but all I could find was the build-time ENABLED(PDF) switches – which is not helpful in my case, as I would like to keep using my distribution's packages), and grepping for enable-something in the built libwebkitgtk did not yield anything either. So... can we have a pdf.js-switch? Or could the the pdf.js machinery at least honour the enable-plugins setting?
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-08-17 03:34:13 PDT
<
rdar://problem/114018319
>
Alberto Garcia
Comment 2
2023-10-13 03:10:26 PDT
Also reported downstream in Debian recently for WebKitGTK:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053713
Michael Catanzaro
Comment 3
2023-10-13 05:42:13 PDT
There is a PdfJSViewerEnabled setting for this, but it's not exposed for WPE/GTK APIs. This would be a good first pull request for anyone interested in contributing. Add the setting to WebKitSettings.h.in and WebKitSettings.cpp, then add a sanity-check test to TestWebKitSettings.cpp just to ensure that toggling the setting works. Most of the work will be copy/pasting from an existing setting and then renaming things.
Michael Catanzaro
Comment 4
2023-10-13 10:56:51 PDT
OK, this can sort of be done already using webkit_settings_get_all_features(), iterate through the list until you find PdfJSViewerEnabled, and then webkit_settings_set_feature_enabled(). That's not very convenient, though.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug