@@ -189,6 +189,8 @@ const PDFViewerApplication = {
189
189
externalServices : DefaultExternalServices ,
190
190
_boundEvents : { } ,
191
191
contentDispositionFilename : null ,
192
+ _hasInteracted : false ,
193
+ _isAcroFormPresent : false ,
192
194
193
195
// Called once when the document is loaded.
194
196
async initialize ( appConfig ) {
@@ -868,10 +870,16 @@ const PDFViewerApplication = {
868
870
PDFJSDev . test ( "MOZCENTRAL || GENERIC" )
869
871
) {
870
872
// Only trigger the fallback once so we don't spam the user with messages
871
- // for one PDF.
873
+ // for one PDF. For forms, it should only be triggered once the user has
874
+ // clicked within the PDF.
872
875
if ( this . fellback ) {
873
876
return ;
874
877
}
878
+
879
+ if ( featureId === UNSUPPORTED_FEATURES . forms && ! this . _hasInteracted ) {
880
+ return ;
881
+ }
882
+
875
883
this . fellback = true ;
876
884
this . externalServices . fallback (
877
885
{
@@ -1317,7 +1325,7 @@ const PDFViewerApplication = {
1317
1325
1318
1326
if ( info . IsAcroFormPresent ) {
1319
1327
console . warn ( "Warning: AcroForm/XFA is not supported" ) ;
1320
- this . fallback ( UNSUPPORTED_FEATURES . forms ) ;
1328
+ this . _isAcroFormPresent = true ;
1321
1329
}
1322
1330
1323
1331
if (
@@ -2473,6 +2481,11 @@ function webViewerWheel(evt) {
2473
2481
}
2474
2482
2475
2483
function webViewerClick ( evt ) {
2484
+ PDFViewerApplication . _hasInteracted = true ;
2485
+ if ( PDFViewerApplication . _isAcroFormPresent ) {
2486
+ PDFViewerApplication . fallback ( UNSUPPORTED_FEATURES . forms ) ;
2487
+ }
2488
+
2476
2489
if ( ! PDFViewerApplication . secondaryToolbar . isOpen ) {
2477
2490
return ;
2478
2491
}
0 commit comments