Bug 260019
| Summary: | [WPE][GTK] There should be an easily accessible way to disable pdf.js at runtime | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Martin Demlon <m> |
| Component: | Assignee: | Nobody <webkit-unassigned> | |
| Status: | NEW | ||
| Severity: | Enhancement | CC: | berto, cgarcia, mcatanzaro, ntim, thorton, webkit-bug-importer, wilander |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | All | ||
| OS: | Linux | ||
Martin Demlon
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
<rdar://problem/114018319>
Alberto Garcia
Also reported downstream in Debian recently for WebKitGTK: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053713
Michael Catanzaro
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
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.
Alberto Garcia
Another related request is whether WebKit can be built to use pdf.js as provided by the distro instead of bundling its own copy inside the binary:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1130768
Michael Catanzaro
I don't think that's related to this bug at all.