Merge pull request #12991 from Snuffleupagus/viewer-Firefox-rm-misc-code

Stop including unused/unnecessary code in the viewer, for `MOZCENTRAL`-builds
This commit is contained in:
Tim van der Meij 2021-02-14 15:17:16 +01:00 committed by GitHub
commit f892c00275
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 13 deletions

View file

@ -824,8 +824,10 @@ const PDFViewerApplication = {
async close() {
this._unblockDocumentLoadEvent();
const errorWrapper = this.appConfig.errorWrapper.container;
errorWrapper.hidden = true;
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
const { container } = this.appConfig.errorWrapper;
container.hidden = true;
}
if (!this.pdfLoadingTask) {
return undefined;
@ -1421,7 +1423,10 @@ const PDFViewerApplication = {
pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => {
this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument });
});
if ("requestIdleCallback" in window) {
if (
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
"requestIdleCallback" in window
) {
const callback = window.requestIdleCallback(
() => {
this._collectTelemetry(pdfDocument);