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?
<rdar://problem/114018319>
Also reported downstream in Debian recently for WebKitGTK: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053713
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.
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.