Bug 1627021 - Update pdf.js to version 2.5.49. r=bdahl
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 02 Apr 2020 18:16:00 +0000
changeset 588676 3390fc3fd4d7d883caba52409942ba99c7d2e0d7
parent 588675 73e0e7a872c3877df14157906a0b3ba3b89b21c4
child 588677 f6ce8518fbf3afea29b9e3fd21998e91538d9ef7
push id2321
push userffxbld-merge
push dateMon, 27 Apr 2020 16:26:39 +0000
treeherdermozilla-release@38a505a56ec4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl
bugs1627021
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1627021 - Update pdf.js to version 2.5.49. r=bdahl Differential Revision: https://phabricator.services.mozilla.com/D69412
browser/extensions/pdfjs/README.mozilla
browser/extensions/pdfjs/content/PdfJsDefaultPreferences.jsm
browser/extensions/pdfjs/content/build/pdf.js
browser/extensions/pdfjs/content/build/pdf.worker.js
browser/extensions/pdfjs/content/web/images/findbarButton-next-rtl.png
browser/extensions/pdfjs/content/web/images/findbarButton-next-rtl@2x.png
browser/extensions/pdfjs/content/web/images/findbarButton-previous-rtl.png
browser/extensions/pdfjs/content/web/images/findbarButton-previous-rtl@2x.png
browser/extensions/pdfjs/content/web/images/toolbarButton-pageDown-rtl.png
browser/extensions/pdfjs/content/web/images/toolbarButton-pageDown-rtl@2x.png
browser/extensions/pdfjs/content/web/images/toolbarButton-pageUp-rtl.png
browser/extensions/pdfjs/content/web/images/toolbarButton-pageUp-rtl@2x.png
browser/extensions/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle-rtl.png
browser/extensions/pdfjs/content/web/images/toolbarButton-secondaryToolbarToggle-rtl@2x.png
browser/extensions/pdfjs/content/web/images/toolbarButton-sidebarToggle-rtl.png
browser/extensions/pdfjs/content/web/images/toolbarButton-sidebarToggle-rtl@2x.png
browser/extensions/pdfjs/content/web/images/toolbarButton-viewOutline-rtl.png
browser/extensions/pdfjs/content/web/images/toolbarButton-viewOutline-rtl@2x.png
browser/extensions/pdfjs/content/web/images/treeitem-collapsed-rtl.png
browser/extensions/pdfjs/content/web/images/treeitem-collapsed-rtl@2x.png
browser/extensions/pdfjs/content/web/viewer.css
browser/extensions/pdfjs/content/web/viewer.js
browser/extensions/pdfjs/moz.yaml
--- 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.5.42
+Current extension version is: 2.5.49
 
-Taken from upstream commit: c12ea21c1
+Taken from upstream commit: 7ed71a0d7
--- a/browser/extensions/pdfjs/content/PdfJsDefaultPreferences.jsm
+++ b/browser/extensions/pdfjs/content/PdfJsDefaultPreferences.jsm
@@ -22,17 +22,16 @@
 "use strict";
 var EXPORTED_SYMBOLS = ["PdfJsDefaultPreferences"];
 var PdfJsDefaultPreferences = Object.freeze({
  "cursorToolOnLoad": 0,
  "defaultZoomValue": "",
  "disablePageLabels": false,
  "enablePrintAutoRotate": false,
  "enableWebGL": false,
- "eventBusDispatchToDOM": false,
  "externalLinkTarget": 0,
  "historyUpdateUrl": false,
  "ignoreDestinationZoom": false,
  "pdfBugEnabled": false,
  "renderer": "canvas",
  "renderInteractiveForms": false,
  "sidebarViewOnLoad": -1,
  "scrollModeOnLoad": -1,
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.5.42';
-var pdfjsBuild = 'c12ea21c1';
+var pdfjsVersion = '2.5.49';
+var pdfjsBuild = '7ed71a0d7';
 
 var pdfjsSharedUtil = __w_pdfjs_require__(1);
 
 var pdfjsDisplayAPI = __w_pdfjs_require__(3);
 
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(16);
 
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(17);
@@ -1213,17 +1213,17 @@ function _fetchDocument(worker, source, 
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
     source.progressiveDone = pdfDataRangeTransport.progressiveDone;
   }
 
   return worker.messageHandler.sendWithPromise("GetDocRequest", {
     docId,
-    apiVersion: '2.5.42',
+    apiVersion: '2.5.49',
     source: {
       data: source.data,
       url: source.url,
       password: source.password,
       disableAutoFetch: source.disableAutoFetch,
       rangeChunkSize: source.rangeChunkSize,
       length: source.length
     },
@@ -3155,19 +3155,19 @@ const InternalRenderTask = function Inte
       }
     }
 
   }
 
   return InternalRenderTask;
 }();
 
-const version = '2.5.42';
+const version = '2.5.49';
 exports.version = version;
-const build = 'c12ea21c1';
+const build = '7ed71a0d7';
 exports.build = build;
 
 /***/ }),
 /* 4 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-const pdfjsVersion = '2.5.42';
-const pdfjsBuild = 'c12ea21c1';
+const pdfjsVersion = '2.5.49';
+const pdfjsBuild = '7ed71a0d7';
 
 const pdfjsCoreWorker = __w_pdfjs_require__(1);
 
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 1 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
@@ -218,17 +218,17 @@ var WorkerMessageHandler = {
 
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     const verbosity = (0, _util.getVerbosityLevel)();
     const apiVersion = docParams.apiVersion;
-    const workerVersion = '2.5.42';
+    const workerVersion = '2.5.49';
 
     if (apiVersion !== workerVersion) {
       throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
     }
 
     var docId = docParams.docId;
     var docBaseUrl = docParams.docBaseUrl;
     var workerHandlerName = docParams.docId + "_worker";
deleted file mode 100644
index bef02743fc108697e14e0e5daab8181f7ef91dd8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1da6dc949cd6451c2d8ea39e1618d0323d2e1ec1..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index de1d0fc901c2d2369660026bd466d4c3f0a62eba..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 0250307c0d10b0c0a38a8381361ec265ef3080c8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1957f79ab95a970cc93eaeadec532661c5a1ae55..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 16ebcb8ef1e923710574bb914e19526f2545abdb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 98e7ce481c163c0d4221be87d262096c631f800e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a01b02380b90e5ab32727ac5460eca3108a8f1e5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 8437095273c46e84b404dcdc1157240cfdd1b454..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 9d9bfa4f63d6a8ae5cbaafa2efadd2c16b48a3d8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 6f85ec061ea167b1718d2865cfc1e53370f11b7a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 291e006797fc7f0e84d297e952630c719fe6eeab..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index aaa9430211e168a593f7e3bb486b3cac2be6556b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 3410f70dfa653e77cd7e6b9e2c69cb2e2869c7ef..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 0496b3577555195f96498932403c030411769159..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 6ad9ebcdf5df5a2aa8d39e01371fc8a5e4663db4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/extensions/pdfjs/content/web/viewer.css
+++ b/browser/extensions/pdfjs/content/web/viewer.css
@@ -1117,56 +1117,56 @@ html[dir='rtl'] #findNext {
 
 html[dir="ltr"] .secondaryToolbarButton::before {
   left: 4px;
 }
 html[dir="rtl"] .secondaryToolbarButton::before {
   right: 4px;
 }
 
-html[dir='ltr'] .toolbarButton#sidebarToggle::before {
+.toolbarButton#sidebarToggle::before {
   content: url(images/toolbarButton-sidebarToggle.png);
 }
 html[dir='rtl'] .toolbarButton#sidebarToggle::before {
-  content: url(images/toolbarButton-sidebarToggle-rtl.png);
+  transform: scaleX(-1);
 }
 
-html[dir='ltr'] .toolbarButton#secondaryToolbarToggle::before {
+.toolbarButton#secondaryToolbarToggle::before {
   content: url(images/toolbarButton-secondaryToolbarToggle.png);
 }
 html[dir='rtl'] .toolbarButton#secondaryToolbarToggle::before {
-  content: url(images/toolbarButton-secondaryToolbarToggle-rtl.png);
+  transform: scaleX(-1);
 }
 
-html[dir='ltr'] .toolbarButton.findPrevious::before {
+.toolbarButton.findPrevious::before {
   content: url(images/findbarButton-previous.png);
 }
 html[dir='rtl'] .toolbarButton.findPrevious::before {
-  content: url(images/findbarButton-previous-rtl.png);
+  transform: scaleX(-1);
 }
 
-html[dir='ltr'] .toolbarButton.findNext::before {
+.toolbarButton.findNext::before {
   content: url(images/findbarButton-next.png);
 }
 html[dir='rtl'] .toolbarButton.findNext::before {
-  content: url(images/findbarButton-next-rtl.png);
+  transform: scaleX(-1);
 }
 
-html[dir='ltr'] .toolbarButton.pageUp::before {
+.toolbarButton.pageUp::before {
   content: url(images/toolbarButton-pageUp.png);
 }
 html[dir='rtl'] .toolbarButton.pageUp::before {
-  content: url(images/toolbarButton-pageUp-rtl.png);
+  transform: scaleX(-1);
 }
 
-html[dir='ltr'] .toolbarButton.pageDown::before {
+.toolbarButton.pageDown::before {
   content: url(images/toolbarButton-pageDown.png);
 }
 html[dir='rtl'] .toolbarButton.pageDown::before {
-  content: url(images/toolbarButton-pageDown-rtl.png);
+  transform: scaleX(-1);
 }
 
 .toolbarButton.zoomOut::before {
   content: url(images/toolbarButton-zoomOut.png);
 }
 
 .toolbarButton.zoomIn::before {
   content: url(images/toolbarButton-zoomIn.png);
@@ -1212,21 +1212,21 @@ html[dir='rtl'] .toolbarButton.pageDown:
 .secondaryToolbarButton.bookmark::before {
   content: url(images/toolbarButton-bookmark.png);
 }
 
 #viewThumbnail.toolbarButton::before {
   content: url(images/toolbarButton-viewThumbnail.png);
 }
 
-html[dir="ltr"] #viewOutline.toolbarButton::before {
+#viewOutline.toolbarButton::before {
   content: url(images/toolbarButton-viewOutline.png);
 }
 html[dir="rtl"] #viewOutline.toolbarButton::before {
-  content: url(images/toolbarButton-viewOutline-rtl.png);
+  transform: scaleX(-1);
 }
 
 #viewAttachments.toolbarButton::before {
   content: url(images/toolbarButton-viewAttachments.png);
 }
 
 #viewFind.toolbarButton::before {
   content: url(images/toolbarButton-search.png);
@@ -1573,21 +1573,21 @@ html[dir='rtl'] .attachmentsItem > butto
   width: 0;
   color: rgba(255, 255, 255, 0.5);
 }
 .outlineItemToggler::before {
   content: url(images/treeitem-expanded.png);
   display: inline-block;
   position: absolute;
 }
-html[dir='ltr'] .outlineItemToggler.outlineItemsHidden::before {
+.outlineItemToggler.outlineItemsHidden::before {
   content: url(images/treeitem-collapsed.png);
 }
 html[dir='rtl'] .outlineItemToggler.outlineItemsHidden::before {
-  content: url(images/treeitem-collapsed-rtl.png);
+  transform: scaleX(-1);
 }
 .outlineItemToggler.outlineItemsHidden ~ .outlineItems {
   display: none;
 }
 html[dir='ltr'] .outlineItemToggler {
   float: left;
 }
 html[dir='rtl'] .outlineItemToggler {
@@ -1928,56 +1928,56 @@ html[dir='rtl'] #documentPropertiesOverl
   }
   html[dir='ltr'] .dropdownToolbarButton::after {
     right: 4px;
   }
   html[dir='rtl'] .dropdownToolbarButton::after {
     left: 4px;
   }
 
-  html[dir='ltr'] .toolbarButton#sidebarToggle::before {
+  .toolbarButton#sidebarToggle::before {
     content: url(images/toolbarButton-sidebarToggle@2x.png);
   }
   html[dir='rtl'] .toolbarButton#sidebarToggle::before {
-    content: url(images/toolbarButton-sidebarToggle-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
-  html[dir='ltr'] .toolbarButton#secondaryToolbarToggle::before {
+  .toolbarButton#secondaryToolbarToggle::before {
     content: url(images/toolbarButton-secondaryToolbarToggle@2x.png);
   }
   html[dir='rtl'] .toolbarButton#secondaryToolbarToggle::before {
-    content: url(images/toolbarButton-secondaryToolbarToggle-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
-  html[dir='ltr'] .toolbarButton.findPrevious::before {
+  .toolbarButton.findPrevious::before {
     content: url(images/findbarButton-previous@2x.png);
   }
   html[dir='rtl'] .toolbarButton.findPrevious::before {
-    content: url(images/findbarButton-previous-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
-  html[dir='ltr'] .toolbarButton.findNext::before {
+  .toolbarButton.findNext::before {
     content: url(images/findbarButton-next@2x.png);
   }
   html[dir='rtl'] .toolbarButton.findNext::before {
-    content: url(images/findbarButton-next-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
-  html[dir='ltr'] .toolbarButton.pageUp::before {
+  .toolbarButton.pageUp::before {
     content: url(images/toolbarButton-pageUp@2x.png);
   }
   html[dir='rtl'] .toolbarButton.pageUp::before {
-    content: url(images/toolbarButton-pageUp-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
-  html[dir='ltr'] .toolbarButton.pageDown::before {
+  .toolbarButton.pageDown::before {
     content: url(images/toolbarButton-pageDown@2x.png);
   }
   html[dir='rtl'] .toolbarButton.pageDown::before {
-    content: url(images/toolbarButton-pageDown-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
   .toolbarButton.zoomIn::before {
     content: url(images/toolbarButton-zoomIn@2x.png);
   }
 
   .toolbarButton.zoomOut::before {
     content: url(images/toolbarButton-zoomOut@2x.png);
@@ -2007,21 +2007,21 @@ html[dir='rtl'] #documentPropertiesOverl
   .secondaryToolbarButton.bookmark::before {
     content: url(images/toolbarButton-bookmark@2x.png);
   }
 
   #viewThumbnail.toolbarButton::before {
     content: url(images/toolbarButton-viewThumbnail@2x.png);
   }
 
-  html[dir="ltr"] #viewOutline.toolbarButton::before {
+  #viewOutline.toolbarButton::before {
     content: url(images/toolbarButton-viewOutline@2x.png);
   }
   html[dir="rtl"] #viewOutline.toolbarButton::before {
-    content: url(images/toolbarButton-viewOutline-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
 
   #viewAttachments.toolbarButton::before {
     content: url(images/toolbarButton-viewAttachments@2x.png);
   }
 
   #viewFind.toolbarButton::before {
     content: url(images/toolbarButton-search@2x.png);
@@ -2079,21 +2079,21 @@ html[dir='rtl'] #documentPropertiesOverl
     content: url(images/secondaryToolbarButton-documentProperties@2x.png);
   }
 
   .outlineItemToggler::before {
     transform: scale(0.5);
     top: -1px;
     content: url(images/treeitem-expanded@2x.png);
   }
-  html[dir='ltr'] .outlineItemToggler.outlineItemsHidden::before {
+  .outlineItemToggler.outlineItemsHidden::before {
     content: url(images/treeitem-collapsed@2x.png);
   }
   html[dir='rtl'] .outlineItemToggler.outlineItemsHidden::before {
-    content: url(images/treeitem-collapsed-rtl@2x.png);
+    transform: scale(-0.5, 0.5);
   }
   html[dir='ltr'] .outlineItemToggler::before {
     right: 0;
   }
   html[dir='rtl'] .outlineItemToggler::before {
     left: 0;
   }
 }
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -367,16 +367,20 @@ class DefaultExternalServices {
 
   static get supportedMouseWheelZoomModifierKeys() {
     return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", {
       ctrlKey: true,
       metaKey: true
     });
   }
 
+  static get isInAutomation() {
+    return (0, _pdfjsLib.shadow)(this, "isInAutomation", false);
+  }
+
 }
 
 exports.DefaultExternalServices = DefaultExternalServices;
 const PDFViewerApplication = {
   initialBookmark: document.location.hash.substring(1),
   _initializedCapability: (0, _pdfjsLib.createPromiseCapability)(),
   fellback: false,
   appConfig: null,
@@ -531,21 +535,21 @@ const PDFViewerApplication = {
       locale: _app_options.AppOptions.get("locale")
     });
     const dir = await this.l10n.getDirection();
     document.getElementsByTagName("html")[0].dir = dir;
   },
 
   async _initializeViewerComponents() {
     const appConfig = this.appConfig;
-    this.overlayManager = new _overlay_manager.OverlayManager();
     const eventBus = appConfig.eventBus || new _ui_utils.EventBus({
-      dispatchToDOM: _app_options.AppOptions.get("eventBusDispatchToDOM")
+      isInAutomation: this.externalServices.isInAutomation
     });
     this.eventBus = eventBus;
+    this.overlayManager = new _overlay_manager.OverlayManager();
     const pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
     pdfRenderingQueue.onIdle = this.cleanup.bind(this);
     this.pdfRenderingQueue = pdfRenderingQueue;
     const pdfLinkService = new _pdf_link_service.PDFLinkService({
       eventBus,
       externalLinkTarget: _app_options.AppOptions.get("externalLinkTarget"),
       externalLinkRel: _app_options.AppOptions.get("externalLinkRel"),
       ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom")
@@ -2535,17 +2539,16 @@ exports.PDFPrintServiceFactory = PDFPrin
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.isValidRotation = isValidRotation;
 exports.isValidScrollMode = isValidScrollMode;
 exports.isValidSpreadMode = isValidSpreadMode;
 exports.isPortraitOrientation = isPortraitOrientation;
-exports.getGlobalEventBus = getGlobalEventBus;
 exports.clamp = clamp;
 exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
 exports.noContextMenuHandler = noContextMenuHandler;
 exports.parseQueryString = parseQueryString;
 exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;
 exports.getVisibleElements = getVisibleElements;
 exports.roundToDivide = roundToDivide;
 exports.getPageSizeInches = getPageSizeInches;
@@ -3099,21 +3102,19 @@ function dispatchDOMEvent(eventName, arg
   }
 
   const event = document.createEvent("CustomEvent");
   event.initCustomEvent(eventName, true, true, details);
   document.dispatchEvent(event);
 }
 
 class EventBus {
-  constructor({
-    dispatchToDOM = false
-  } = {}) {
+  constructor(options) {
     this._listeners = Object.create(null);
-    this._dispatchToDOM = dispatchToDOM === true;
+    this._isInAutomation = (options && options.isInAutomation) === true;
   }
 
   on(eventName, listener) {
     this._on(eventName, listener, {
       external: true
     });
   }
 
@@ -3122,17 +3123,17 @@ class EventBus {
       external: true
     });
   }
 
   dispatch(eventName) {
     const eventListeners = this._listeners[eventName];
 
     if (!eventListeners || eventListeners.length === 0) {
-      if (this._dispatchToDOM) {
+      if (this._isInAutomation) {
         const args = Array.prototype.slice.call(arguments, 1);
         dispatchDOMEvent(eventName, args);
       }
 
       return;
     }
 
     const args = Array.prototype.slice.call(arguments, 1);
@@ -3155,17 +3156,17 @@ class EventBus {
 
     if (externalListeners) {
       externalListeners.forEach(function (listener) {
         listener.apply(null, args);
       });
       externalListeners = null;
     }
 
-    if (this._dispatchToDOM) {
+    if (this._isInAutomation) {
       dispatchDOMEvent(eventName, args);
     }
   }
 
   _on(eventName, listener, options = null) {
     let eventListeners = this._listeners[eventName];
 
     if (!eventListeners) {
@@ -3191,29 +3192,16 @@ class EventBus {
         return;
       }
     }
   }
 
 }
 
 exports.EventBus = EventBus;
-let globalEventBus = null;
-
-function getGlobalEventBus(dispatchToDOM = false) {
-  console.error("getGlobalEventBus is deprecated, use a manually created EventBus instance instead.");
-
-  if (!globalEventBus) {
-    globalEventBus = new EventBus({
-      dispatchToDOM
-    });
-  }
-
-  return globalEventBus;
-}
 
 function clamp(v, min, max) {
   return Math.min(Math.max(v, min), max);
 }
 
 class ProgressBar {
   constructor(id, {
     height,
@@ -3356,20 +3344,16 @@ const defaultOptions = {
   enablePrintAutoRotate: {
     value: false,
     kind: OptionKind.VIEWER + OptionKind.PREFERENCE
   },
   enableWebGL: {
     value: false,
     kind: OptionKind.VIEWER + OptionKind.PREFERENCE
   },
-  eventBusDispatchToDOM: {
-    value: false,
-    kind: OptionKind.VIEWER + OptionKind.PREFERENCE
-  },
   externalLinkRel: {
     value: "noopener noreferrer nofollow",
     kind: OptionKind.VIEWER
   },
   externalLinkTarget: {
     value: 0,
     kind: OptionKind.VIEWER + OptionKind.PREFERENCE
   },
@@ -5027,36 +5011,36 @@ exports.PDFDocumentProperties = PDFDocum
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.PDFFindBar = void 0;
 
+var _pdf_find_controller = __webpack_require__(15);
+
 var _ui_utils = __webpack_require__(2);
 
-var _pdf_find_controller = __webpack_require__(15);
-
 const MATCHES_COUNT_LIMIT = 1000;
 
 class PDFFindBar {
   constructor(options, eventBus, l10n = _ui_utils.NullL10n) {
     this.opened = false;
     this.bar = options.bar || null;
     this.toggleButton = options.toggleButton || null;
     this.findField = options.findField || null;
     this.highlightAll = options.highlightAllCheckbox || null;
     this.caseSensitive = options.caseSensitiveCheckbox || null;
     this.entireWord = options.entireWordCheckbox || null;
     this.findMsg = options.findMsg || null;
     this.findResultsCount = options.findResultsCount || null;
     this.findPreviousButton = options.findPreviousButton || null;
     this.findNextButton = options.findNextButton || null;
-    this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = eventBus;
     this.l10n = l10n;
     this.toggleButton.addEventListener("click", () => {
       this.toggle();
     });
     this.findField.addEventListener("input", () => {
       this.dispatchEvent("");
     });
     this.bar.addEventListener("keydown", e => {
@@ -5238,22 +5222,22 @@ exports.PDFFindBar = PDFFindBar;
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.PDFFindController = exports.FindState = void 0;
 
-var _ui_utils = __webpack_require__(2);
-
 var _pdfjsLib = __webpack_require__(4);
 
 var _pdf_find_utils = __webpack_require__(16);
 
+var _ui_utils = __webpack_require__(2);
+
 const FindState = {
   FOUND: 0,
   NOT_FOUND: 1,
   WRAPPED: 2,
   PENDING: 3
 };
 exports.FindState = FindState;
 const FIND_TIMEOUT = 250;
@@ -5286,17 +5270,17 @@ function normalize(text) {
 }
 
 class PDFFindController {
   constructor({
     linkService,
     eventBus
   }) {
     this._linkService = linkService;
-    this._eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this._eventBus = eventBus;
 
     this._reset();
 
     eventBus._on("findbarclose", this._onFindBarClose.bind(this));
   }
 
   get highlightMatches() {
     return this._highlightMatches;
@@ -6033,17 +6017,17 @@ function getCurrentHash() {
 }
 
 class PDFHistory {
   constructor({
     linkService,
     eventBus
   }) {
     this.linkService = linkService;
-    this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = eventBus;
     this._initialized = false;
     this._fingerprint = "";
     this.reset();
     this._boundEvents = null;
     this._isViewerInPresentationMode = false;
 
     this.eventBus._on("presentationmodechanged", evt => {
       this._isViewerInPresentationMode = evt.active || evt.switchInProgress;
@@ -6611,17 +6595,17 @@ var _ui_utils = __webpack_require__(2);
 class PDFLinkService {
   constructor({
     eventBus,
     externalLinkTarget = null,
     externalLinkRel = null,
     externalLinkEnabled = true,
     ignoreDestinationZoom = false
   } = {}) {
-    this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = eventBus;
     this.externalLinkTarget = externalLinkTarget;
     this.externalLinkRel = externalLinkRel;
     this.externalLinkEnabled = externalLinkEnabled;
     this._ignoreDestinationZoom = ignoreDestinationZoom;
     this.baseUrl = null;
     this.pdfDocument = null;
     this.pdfViewer = null;
     this.pdfHistory = null;
@@ -8618,17 +8602,17 @@ class BaseViewer {
   constructor(options) {
     if (this.constructor === BaseViewer) {
       throw new Error("Cannot initialize BaseViewer.");
     }
 
     this._name = this.constructor.name;
     this.container = options.container;
     this.viewer = options.viewer || options.container.firstElementChild;
-    this.eventBus = options.eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = options.eventBus;
     this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
     this.downloadManager = options.downloadManager || null;
     this.findController = options.findController || null;
     this.removePageBorders = options.removePageBorders || false;
     this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
     this.imageResourcesPath = options.imageResourcesPath || "";
     this.renderInteractiveForms = options.renderInteractiveForms || false;
     this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
@@ -9802,17 +9786,17 @@ class PDFPageView {
     this.viewport = defaultViewport;
     this.pdfPageRotate = defaultViewport.rotation;
     this.hasRestrictedScaling = false;
     this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;
     this.imageResourcesPath = options.imageResourcesPath || "";
     this.renderInteractiveForms = options.renderInteractiveForms || false;
     this.useOnlyCssZoom = options.useOnlyCssZoom || false;
     this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;
-    this.eventBus = options.eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = options.eventBus;
     this.renderingQueue = options.renderingQueue;
     this.textLayerFactory = options.textLayerFactory;
     this.annotationLayerFactory = options.annotationLayerFactory;
     this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;
     this.enableWebGL = options.enableWebGL || false;
     this.l10n = options.l10n || _ui_utils.NullL10n;
     this.paintTask = null;
     this.paintedViewportMap = new WeakMap();
@@ -10343,33 +10327,31 @@ exports.PDFPageView = PDFPageView;
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
 exports.DefaultTextLayerFactory = exports.TextLayerBuilder = void 0;
 
-var _ui_utils = __webpack_require__(2);
-
 var _pdfjsLib = __webpack_require__(4);
 
 const EXPAND_DIVS_TIMEOUT = 300;
 
 class TextLayerBuilder {
   constructor({
     textLayerDiv,
     eventBus,
     pageIndex,
     viewport,
     findController = null,
     enhanceTextSelection = false
   }) {
     this.textLayerDiv = textLayerDiv;
-    this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
+    this.eventBus = eventBus;
     this.textContent = null;
     this.textContentItemsStr = [];
     this.textContentStream = null;
     this.renderingDone = false;
     this.pageIdx = pageIndex;
     this.pageNumber = this.pageIdx + 1;
     this.matches = [];
     this.viewport = viewport;
@@ -11833,16 +11815,21 @@ class FirefoxExternalServices extends _a
     return (0, _pdfjsLib.shadow)(this, "supportsDocumentFonts", support);
   }
 
   static get supportedMouseWheelZoomModifierKeys() {
     const support = FirefoxCom.requestSync("supportedMouseWheelZoomModifierKeys");
     return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", support);
   }
 
+  static get isInAutomation() {
+    const isInAutomation = FirefoxCom.requestSync("isInAutomation");
+    return (0, _pdfjsLib.shadow)(this, "isInAutomation", isInAutomation);
+  }
+
 }
 
 _app.PDFViewerApplication.externalServices = FirefoxExternalServices;
 document.mozL10n.setExternalLocalizerServices({
   getLocale() {
     return FirefoxCom.requestSync("getLocale", null);
   },
 
@@ -11991,17 +11978,16 @@ let defaultPreferences = null;
 function getDefaultPreferences() {
   if (!defaultPreferences) {
     defaultPreferences = Promise.resolve({
       "cursorToolOnLoad": 0,
       "defaultZoomValue": "",
       "disablePageLabels": false,
       "enablePrintAutoRotate": false,
       "enableWebGL": false,
-      "eventBusDispatchToDOM": false,
       "externalLinkTarget": 0,
       "historyUpdateUrl": false,
       "ignoreDestinationZoom": false,
       "pdfBugEnabled": false,
       "renderer": "canvas",
       "renderInteractiveForms": false,
       "sidebarViewOnLoad": -1,
       "scrollModeOnLoad": -1,
--- a/browser/extensions/pdfjs/moz.yaml
+++ b/browser/extensions/pdfjs/moz.yaml
@@ -15,15 +15,15 @@ origin:
   description: Portable Document Format (PDF) viewer that is built with HTML5
 
   # Full URL for the package's homepage/etc
   # Usually different from repository url
   url: https://github.com/mozilla/pdf.js
 
   # Human-readable identifier for this version/release
   # Generally "version NNN", "tag SSS", "bookmark SSS"
-  release: version 2.5.42
+  release: version 2.5.49
 
   # The package's license, where possible using the mnemonic from
   # https://spdx.org/licenses/
   # Multiple licenses can be specified (as a YAML list)
   # A "LICENSE" file must exist containing the full license text
   license: Apache-2.0