Directly use requestIdleCallback in MOZCENTRAL-builds

Given the following compatibility information, we really shouldn't need to check for the availability of `requestIdleCallback` in Firefox; see https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback#browser_compatibility
This commit is contained in:
Jonas Jenwald 2021-02-14 10:39:42 +01:00
parent 7f8a9b12d9
commit 1ca816d724

View File

@ -1423,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);