This avoids a sync IPC message from child to parent. Changes entirely from: https://github.com/mozilla/pdf.js/pull/8218 MozReview-Commit-ID: 3Egayok3DBZ
One is always run, the other is only run when PdfJs.enabled is true in the parent process. This refactoring enables the next patch. The extensions changes are from: https://github.com/mozilla/pdf.js/pull/8218 MozReview-Commit-ID: HwQ3yk8Jck4