Update PDF.js
To update PDF.js:
Go to https://github.com/mozilla/pdf.js/releases/latest and download the
pdfjs-<VERSION>-dist.zip
file.Remove the old files:
git rm -r asset/vendor/pdf.js
Extract the .zip file contents inside
asset/vendor/pdf.js
:unzip pdfjs-<VERSION>-dist.zip -d asset/vendor/pdf.js
Edit
asset/vendor/pdf.js/web/viewer.js
and addwindow.location.origin
toHOSTED_VIEWER_ORIGINS
. It should look like this:const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io", window.location.origin];
Commit!
git add asset/vendor/pdf.js && git commit -m 'Update PDF.js to <VERSION>'