@@ -864,11 +864,27 @@ const PDFViewerApplication = {
864
864
. catch ( downloadByUrl ) ; // Error occurred, try downloading with the URL.
865
865
} ,
866
866
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
+
867
879
fallback ( featureId ) {
868
880
if (
869
881
typeof PDFJSDev === "undefined" ||
870
882
PDFJSDev . test ( "MOZCENTRAL || GENERIC" )
871
883
) {
884
+ if ( featureId ) {
885
+ this . _recordFallbackErrorTelemetry ( featureId ) ;
886
+ }
887
+
872
888
// For PDFs that contain script and form errors, we should only trigger
873
889
// the fallback once the user has interacted with the page.
874
890
if ( this . _delayedFallbackFeatureIds . length >= 1 && this . _hasInteracted ) {
@@ -1247,6 +1263,7 @@ const PDFViewerApplication = {
1247
1263
}
1248
1264
console . warn ( "Warning: JavaScript is not supported" ) ;
1249
1265
this . _delayedFallbackFeatureIds . push ( UNSUPPORTED_FEATURES . javaScript ) ;
1266
+ this . _recordFallbackErrorTelemetry ( UNSUPPORTED_FEATURES . javaScript ) ;
1250
1267
return true ;
1251
1268
} ) ;
1252
1269
@@ -1329,6 +1346,7 @@ const PDFViewerApplication = {
1329
1346
if ( info . IsAcroFormPresent ) {
1330
1347
console . warn ( "Warning: AcroForm/XFA is not supported" ) ;
1331
1348
this . _delayedFallbackFeatureIds . push ( UNSUPPORTED_FEATURES . forms ) ;
1349
+ this . _recordFallbackErrorTelemetry ( UNSUPPORTED_FEATURES . forms ) ;
1332
1350
}
1333
1351
1334
1352
if (
0 commit comments