[Webkit-unassigned] [Bug 237513] [GTK][WPE] Add initial support for PDF documents using PDF.js

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 8 00:29:47 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=237513

--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 453949
  --> https://bugs.webkit.org/attachment.cgi?id=453949
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453949&action=review

>> Source/WebCore/page/SecurityOrigin.cpp:124
>> +        || url.protocolIs("webkit-pdfjs-viewer")
> 
> This is surely required for all ports using PDF.js, not just GTK and WPE. Better check PdfJSViewerEnabled instead of using #if.

It's enabled unconditionally for GTK and WPE. We can discuss if we want to add api to enable/disable it, though. But for now, I think it's easier this way. Cocoa doesn't do this because they have :

// Allow images to load.
response.addHTTPHeaderField(HTTPHeaderName::AccessControlAllowOrigin, "*");

in the bundle resource loader. I  did it this way for consistency with gresources, since webkit-pdfjs-viewer are gresources too in the end.

>> Source/WebCore/platform/LegacySchemeRegistry.cpp:148
>>  #endif
> 
> If you change this from std::array to std::vector, then you can check the runtime setting PdfJSViewerEnabled here too.

And same here.

>> Tools/glib/generate-pdfjs-gresource-manifest.py:35
>> +            return True
> 
> Hm, I don't like this: we'll likely drop desired files by mistake during future updates of PDF.js. I'd either (a) drop this altogether and just include everything, or (b) use a denylist containing just '.map' as a sanity-check to ensure we don't include those pre-generated map files by mistake.

I think it's unlikely new file types are added in new versions. I've tried hard to not add any file we don't need to the bundle, because it's already big enough. If it breaks after an upgrade we can easily fix it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220308/ad69d548/attachment-0001.htm>


More information about the webkit-unassigned mailing list