New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PROD-1184 fixed pdf loading issue in textbook #22920
Conversation
6c87e92
to
79ce1bd
Compare
79ce1bd
to
0452997
Compare
Your PR has finished running tests. There were no failures. |
@AhtishamShahid Please add a staging link where the issue is reproducible. |
The link is added in the description. |
@AhtishamShahid Even though code is working but I am not understanding why executing the code in a separate thread is causing the issue. Can you please elaborate on this and/or update the PR description to reflect the decision you made? |
@@ -44,12 +44,13 @@ | |||
<script type="text/javascript"> | |||
PDFJS.imageResourcesPath = "${static.url('css/vendor/pdfjs/images/') | n, js_escaped_string}"; | |||
PDFJS.workerSrc = "${static.url('js/vendor/pdfjs/pdf.worker.js') | n, js_escaped_string}"; | |||
PDFJS.disableWorker = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what this specifically mean? how this resolves the problem for Mozilla Firefox browser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what this specifically mean? how this resolves the problem for Mozilla Firefox browser?
There is a browser compatibility issue with PDFJS while using it with CDNs there are other ways around, but it seems disabling worker is the simplest way to counter that problem.
@DawoudSheraz @awaisdar001
For more context, you can look into this thread.
mozilla/pdf.js#5490 (comment)
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
PROD-1184
Issue
PDF textbook not loading for a course on Firefox only. The same file does load in Chrome. While it may seem a valid workaround to use Chrome, to communicate to learners to use Chrome to read the PDF is not the desired user experience.
Fix
This PR fixes above mentioned issue by removing
PDFJS.workerSrc
call which was reduandant and replaced it withPDFJS.disableWorker = true
Test
Sandbox : sandbox
Click sand box link above you should be able to view pdf file in firefox browser