Remove the "tagged" telemetry-reporting

Given that this is no longer being recorded in Firefox, it shouldn't be necessary to keep the associated code in the default viewer.
This commit is contained in:
Jonas Jenwald 2022-09-06 13:00:44 +02:00
parent b4b9ce83ed
commit c70ceecff4

View File

@ -260,7 +260,6 @@ const PDFViewerApplication = {
_saveInProgress: false, _saveInProgress: false,
_docStats: null, _docStats: null,
_wheelUnusedTicks: 0, _wheelUnusedTicks: 0,
_idleCallbacks: new Set(),
_PDFBug: null, _PDFBug: null,
_hasAnnotationEditors: false, _hasAnnotationEditors: false,
_title: document.title, _title: document.title,
@ -816,19 +815,6 @@ const PDFViewerApplication = {
secondaryToolbar.viewBookmarkButton.hidden = true; secondaryToolbar.viewBookmarkButton.hidden = true;
}, },
/**
* @private
*/
_cancelIdleCallbacks() {
if (!this._idleCallbacks.size) {
return;
}
for (const callback of this._idleCallbacks) {
window.cancelIdleCallback(callback);
}
this._idleCallbacks.clear();
},
/** /**
* Closes opened PDF document. * Closes opened PDF document.
* @returns {Promise} - Returns the promise, which is resolved when all * @returns {Promise} - Returns the promise, which is resolved when all
@ -886,7 +872,6 @@ const PDFViewerApplication = {
this._docStats = null; this._docStats = null;
this._hasAnnotationEditors = false; this._hasAnnotationEditors = false;
this._cancelIdleCallbacks();
promises.push(this.pdfScriptingManager.destroyPromise); promises.push(this.pdfScriptingManager.destroyPromise);
this.setTitle(); this.setTitle();
@ -1427,19 +1412,6 @@ const PDFViewerApplication = {
} }
this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument }); this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument });
}); });
if (
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
"requestIdleCallback" in window
) {
const callback = window.requestIdleCallback(
() => {
this._collectTelemetry(pdfDocument);
this._idleCallbacks.delete(callback);
},
{ timeout: 1000 }
);
this._idleCallbacks.add(callback);
}
}); });
this._initializePageLabels(pdfDocument); this._initializePageLabels(pdfDocument);
@ -1486,23 +1458,6 @@ const PDFViewerApplication = {
}; };
}, },
/**
* A place to fetch data for telemetry after one page is rendered and the
* viewer is idle.
* @private
*/
async _collectTelemetry(pdfDocument) {
const markInfo = await this.pdfDocument.getMarkInfo();
if (pdfDocument !== this.pdfDocument) {
return; // Document was closed while waiting for mark info.
}
const tagged = markInfo?.Marked || false;
this.externalServices.reportTelemetry({
type: "tagged",
tagged,
});
},
/** /**
* @private * @private
*/ */