mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
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:
commit
f892c00275
4 changed files with 23 additions and 13 deletions
11
web/app.js
11
web/app.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue