mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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:
parent
7f8a9b12d9
commit
1ca816d724
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue