Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lms/templates/pdf_viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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)

PDFJS.cMapUrl = "${static.url('css/vendor/pdfjs/cmaps/') | n, js_escaped_string}";
PDF_URL = '${current_url | n, js_escaped_string}';
</script>

<script ${static.url('js/vendor/pdfjs/debugger.js')}></script>

<%static:js group='main_vendor'/>
<%static:js group='application'/>
<%static:js group='courseware'/>
Expand Down Expand Up @@ -147,7 +148,7 @@
<button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" data-l10n-id="hand_tool_enable">
<span data-l10n-id="hand_tool_enable_label">Enable hand tool</span>
</button>

<div class="horizontalToolbarSeparator"></div>

<button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties…" data-l10n-id="document_properties">
Expand Down Expand Up @@ -202,10 +203,10 @@
</a>

<div class="verticalToolbarSeparator hiddenSmallView"></div>

<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" data-l10n-id="tools">
<span data-l10n-id="tools_label">Tools</span>
</button>
</button>
</div>
<div class="outerCenter">
<div class="innerCenter" id="toolbarViewerMiddle">
Expand Down