Skip to content

Commit 9faf233

Browse files
committed
For #11961: collect telemetry on all unique unsupported features that trigger fallback error.
This expands upon the telemetry we are collecting that shows the fallback error.
1 parent 973936f commit 9faf233

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

web/app.js

+18
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,27 @@ const PDFViewerApplication = {
864864
.catch(downloadByUrl); // Error occurred, try downloading with the URL.
865865
},
866866

867+
_recordFallbackErrorTelemetry(featureId) {
868+
if (
869+
typeof PDFJSDev === "undefined" ||
870+
PDFJSDev.test("MOZCENTRAL")
871+
) {
872+
this.externalServices.reportTelemetry({
873+
type: "unsupportedFeature",
874+
featureId,
875+
});
876+
}
877+
},
878+
867879
fallback(featureId) {
868880
if (
869881
typeof PDFJSDev === "undefined" ||
870882
PDFJSDev.test("MOZCENTRAL || GENERIC")
871883
) {
884+
if (featureId) {
885+
this._recordFallbackErrorTelemetry(featureId);
886+
}
887+
872888
// For PDFs that contain script and form errors, we should only trigger
873889
// the fallback once the user has interacted with the page.
874890
if (this._delayedFallbackFeatureIds.length >= 1 && this._hasInteracted) {
@@ -1247,6 +1263,7 @@ const PDFViewerApplication = {
12471263
}
12481264
console.warn("Warning: JavaScript is not supported");
12491265
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.javaScript);
1266+
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.javaScript);
12501267
return true;
12511268
});
12521269

@@ -1329,6 +1346,7 @@ const PDFViewerApplication = {
13291346
if (info.IsAcroFormPresent) {
13301347
console.warn("Warning: AcroForm/XFA is not supported");
13311348
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.forms);
1349+
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.forms);
13321350
}
13331351

13341352
if (

0 commit comments

Comments
 (0)