diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index bec77ff58254..9b711d4ccf61 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.1.97 +Current extension version is: 2.1.117 -Taken from upstream commit: 45c01974 +Taken from upstream commit: 417c234c diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index 48a6f7aeccec..3f8fc8246663 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.1.97'; -var pdfjsBuild = '45c01974'; +var pdfjsVersion = '2.1.117'; +var pdfjsBuild = '417c234c'; var pdfjsSharedUtil = __w_pdfjs_require__(1); @@ -5141,7 +5141,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.1.97', + apiVersion: '2.1.117', source: { data: source.data, url: source.url, @@ -6860,9 +6860,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() { return InternalRenderTask; }(); -const version = '2.1.97'; +const version = '2.1.117'; exports.version = version; -const build = '45c01974'; +const build = '417c234c'; exports.build = build; /***/ }), diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index c83f94c6382b..433d365d68fb 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.1.97'; -var pdfjsBuild = '45c01974'; +var pdfjsVersion = '2.1.117'; +var pdfjsBuild = '417c234c'; var pdfjsCoreWorker = __w_pdfjs_require__(1); @@ -375,7 +375,7 @@ var WorkerMessageHandler = { var cancelXHRs = null; var WorkerTasks = []; let apiVersion = docParams.apiVersion; - let workerVersion = '2.1.97'; + let workerVersion = '2.1.117'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); @@ -22045,6 +22045,7 @@ class WidgetAnnotation extends Annotation { data.readOnly = this.hasFieldFlag(_util.AnnotationFieldFlag.READONLY); if (data.fieldType === 'Sig') { + data.fieldValue = null; this.setFlags(_util.AnnotationFlag.HIDDEN); } } diff --git a/browser/extensions/pdfjs/content/web/viewer.css b/browser/extensions/pdfjs/content/web/viewer.css index aa89a047d486..a86671cb78e4 100644 --- a/browser/extensions/pdfjs/content/web/viewer.css +++ b/browser/extensions/pdfjs/content/web/viewer.css @@ -1930,7 +1930,7 @@ html[dir='rtl'] #documentPropertiesOverlay .row > * { display: none; } -@media screen and (min-resolution: 2dppx) { +@media screen and (min-resolution: 1.1dppx) { /* Rules for Retina screens */ .toolbarButton::before { transform: scale(0.5); diff --git a/browser/extensions/pdfjs/content/web/viewer.js b/browser/extensions/pdfjs/content/web/viewer.js index 6701ba387847..e5171ebf9ff2 100644 --- a/browser/extensions/pdfjs/content/web/viewer.js +++ b/browser/extensions/pdfjs/content/web/viewer.js @@ -323,6 +323,7 @@ var _view_history = __webpack_require__(32); const DEFAULT_SCALE_DELTA = 1.1; const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; const FORCE_PAGES_LOADED_TIMEOUT = 10000; +const WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; const DefaultExternalServices = { updateFindControlState(data) {}, @@ -1423,6 +1424,7 @@ let PDFViewerApplication = { }); }; + window.addEventListener('visibilitychange', webViewerVisibilityChange); window.addEventListener('wheel', webViewerWheel); window.addEventListener('click', webViewerClick); window.addEventListener('keydown', webViewerKeyDown); @@ -1482,6 +1484,7 @@ let PDFViewerApplication = { let { _boundEvents } = this; + window.removeEventListener('visibilitychange', webViewerVisibilityChange); window.removeEventListener('wheel', webViewerWheel); window.removeEventListener('click', webViewerClick); window.removeEventListener('keydown', webViewerKeyDown); @@ -1917,8 +1920,23 @@ function webViewerPageChanging(evt) { } } -let zoomDisabled = false, - zoomDisabledTimeout; +function webViewerVisibilityChange(evt) { + if (document.visibilityState === 'visible') { + setZoomDisabledTimeout(); + } +} + +let zoomDisabledTimeout = null; + +function setZoomDisabledTimeout() { + if (zoomDisabledTimeout) { + clearTimeout(zoomDisabledTimeout); + } + + zoomDisabledTimeout = setTimeout(function () { + zoomDisabledTimeout = null; + }, WHEEL_ZOOM_DISABLED_TIMEOUT); +} function webViewerWheel(evt) { let pdfViewer = PDFViewerApplication.pdfViewer; @@ -1936,7 +1954,7 @@ function webViewerWheel(evt) { evt.preventDefault(); - if (zoomDisabled) { + if (zoomDisabledTimeout || document.visibilityState === 'hidden') { return; } @@ -1962,11 +1980,7 @@ function webViewerWheel(evt) { pdfViewer.container.scrollTop += dy * scaleCorrectionFactor; } } else { - zoomDisabled = true; - clearTimeout(zoomDisabledTimeout); - zoomDisabledTimeout = setTimeout(function () { - zoomDisabled = false; - }, 1000); + setZoomDisabledTimeout(); } } @@ -2209,6 +2223,10 @@ function webViewerKeyDown(evt) { case 82: PDFViewerApplication.rotatePages(90); break; + + case 115: + PDFViewerApplication.pdfSidebar.toggle(); + break; } if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === 'page-fit')) { diff --git a/browser/extensions/pdfjs/moz.yaml b/browser/extensions/pdfjs/moz.yaml index a8cf7db20591..07c1d12d4ed3 100644 --- a/browser/extensions/pdfjs/moz.yaml +++ b/browser/extensions/pdfjs/moz.yaml @@ -20,7 +20,7 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: version 2.1.97 + release: version 2.1.117 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/