1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[Editor] Add some telemetry for the highlight feature (bug 1866437)

This commit is contained in:
Calixte Denizet 2024-02-27 21:44:13 +01:00
parent e42b114e80
commit 65342d2bee
9 changed files with 186 additions and 51 deletions

View file

@ -248,17 +248,12 @@ class AltTextManager {
}
#close() {
this.#eventBus.dispatch("reporttelemetry", {
source: this,
details: {
type: "editing",
subtype: this.#currentEditor.editorType,
data: this.#telemetryData || {
action: "alt_text_cancel",
alt_text_keyboard: !this.#hasUsedPointer,
},
},
});
this.#currentEditor._reportTelemetry(
this.#telemetryData || {
action: "alt_text_cancel",
alt_text_keyboard: !this.#hasUsedPointer,
}
);
this.#telemetryData = null;
this.#removeOnClickListeners();

View file

@ -1152,7 +1152,10 @@ const PDFViewerApplication = {
if (this._hasAnnotationEditors) {
this.externalServices.reportTelemetry({
type: "editing",
data: { type: "save" },
data: {
type: "save",
stats: this.pdfDocument?.annotationStorage.editorStats,
},
});
}
},
@ -1727,13 +1730,6 @@ const PDFViewerApplication = {
annotationStorage.onAnnotationEditor = typeStr => {
this._hasAnnotationEditors = !!typeStr;
this.setTitle();
if (typeStr) {
this.externalServices.reportTelemetry({
type: "editing",
data: { type: typeStr },
});
}
};
},
@ -1857,7 +1853,10 @@ const PDFViewerApplication = {
if (this._hasAnnotationEditors) {
this.externalServices.reportTelemetry({
type: "editing",
data: { type: "print" },
data: {
type: "print",
stats: this.pdfDocument?.annotationStorage.editorStats,
},
});
}
},