Skip to content

Fix PDF.js integration with MIME database update during build

Tobias Grasse requested to merge fix-pdfjs-integration into main

This fixes snap-specific issues with WPE 2.38’s new PDF.js integration: Loading a PDF via URL showed no error, but all bundled PDF.js resources were listed with 0KB size in the web inspector, and the PDF did not render. Turns out we need to re-build the MIME database during snap build so that WPE has all MIME types available inside the snap. With this adjustment, PDFs are loaded and rendered correctly. This PR also sets the WPE_SHELL_MEDIA_DISK_CACHE_PATH environment variable separately for the snap service and the on-demand app. Noticed that TMPDIR may be undefined in certain circumstances, and we can avoid permission issues as the service runs as another user than the app.

Edited by Tobias Grasse

Merge request reports