Skip to content

Commit 05fe9c8

Browse files
committed
For mozilla#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 05fe9c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

web/app.js

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

867+
_recordFallbackErrorTelemetry(featureId) {
868+
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("MOZCENTRAL")) {
869+
this.externalServices.reportTelemetry({
870+
type: "unsupportedFeature",
871+
featureId,
872+
});
873+
}
874+
},
875+
867876
fallback(featureId) {
868877
if (
869878
typeof PDFJSDev === "undefined" ||
870879
PDFJSDev.test("MOZCENTRAL || GENERIC")
871880
) {
881+
if (featureId) {
882+
this._recordFallbackErrorTelemetry(featureId);
883+
}
884+
872885
// For PDFs that contain script and form errors, we should only trigger
873886
// the fallback once the user has interacted with the page.
874887
if (this._delayedFallbackFeatureIds.length >= 1 && this._hasInteracted) {
@@ -1247,6 +1260,7 @@ const PDFViewerApplication = {
12471260
}
12481261
console.warn("Warning: JavaScript is not supported");
12491262
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.javaScript);
1263+
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.javaScript);
12501264
return true;
12511265
});
12521266

@@ -1329,6 +1343,7 @@ const PDFViewerApplication = {
13291343
if (info.IsAcroFormPresent) {
13301344
console.warn("Warning: AcroForm/XFA is not supported");
13311345
this._delayedFallbackFeatureIds.push(UNSUPPORTED_FEATURES.forms);
1346+
this._recordFallbackErrorTelemetry(UNSUPPORTED_FEATURES.forms);
13321347
}
13331348

13341349
if (

0 commit comments

Comments
 (0)