Open mflorea opened 1 month ago
pdf.js has been refactored into JavaScript modules and this creates two problems for us:
.mjs
files from WebJars are served as plain/text
(even on the latest version of XWiki). The latest version of Tika fixes this, but we need to support XWiki 14.10+ so we need a workaround for older versions. Adding a custom mime type mapping as per https://tika.apache.org/1.8/parser_guide.html#Add_your_MIME-Type works, but we need to see if we can't do something automatic, that doesn't involve asking all administrators to put a custom Tika configuration file in their XWiki WAR. For reference, the mine type is determined here https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/src/main/java/org/xwiki/webjars/internal/WebJarsResourceReferenceHandler.java#L137 .PDFViewerApplication
) are no longer available. We probably need to transform our custom code in a JavaScript module and inject the required dependencies, but I haven't found exactly which dependencies to inject.
We're a bit behind.