Repository navigation
Features
- Individual runtime file URLs. New
pdfjs-lib-src,viewer-src,viewer-css-srcandtheme-css-srcattributes set the URL of each viewer runtime file on its own, alongside the existingworker-src. They work with or withoutassets-baseand are made for static asset pipelines that emit content-hashed file names, such as Django'sManifestStaticFilesStorage. See the newdemo/asset-attributes.html. (#57, thanks @nvi9)
Fixes
viewer-css-theme="LIGHT"now stays light when the operating system prefers dark. The element setshtml[data-color-scheme="light|dark"]inside the viewer document, and the Paper & Ink theme selects its forced palettes by that attribute.LIGHTalso no longer picks up PDF.js's dark hover and disabled-button styles. (#58, thanks @nvi9; #60)- A forced theme is applied before PDF.js initializes, so the first paint already uses it. (#60)
- Runtime file URL handling: URLs are read once per viewer build so the iframe's CSP always matches the files it loads; stylesheet URLs are escaped when written into the viewer document; attribute values are trimmed; and
worker-srcset at runtime is normalized the same way as at load. (#57, #59)
Documentation
- All runtime files must come from the same package release as the element.
LIGHTandDARKoverride the system color scheme;AUTOMATIC(the default) follows it.
Compatibility
No breaking changes. Custom themes loaded through theme-css-src that still match the inline color-scheme style keep working, since the element continues to set it.