File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1329,12 +1329,33 @@ const PDFViewerApplication = {
1329
1329
pdfViewer . optionalContentConfigPromise . then ( optionalContentConfig => {
1330
1330
this . pdfLayerViewer . render ( { optionalContentConfig, pdfDocument } ) ;
1331
1331
} ) ;
1332
+ if ( "requestIdleCallback" in window ) {
1333
+ window . requestIdleCallback ( ( ) => {
1334
+ this . _collectTelemetry ( ) ;
1335
+ } ) ;
1336
+ }
1332
1337
} ) ;
1333
1338
1334
1339
this . _initializePageLabels ( pdfDocument ) ;
1335
1340
this . _initializeMetadata ( pdfDocument ) ;
1336
1341
} ,
1337
1342
1343
+ /**
1344
+ * A place to fetch data for telemetry after one page is rendered and the
1345
+ * viewer is idle.
1346
+ */
1347
+ async _collectTelemetry ( ) {
1348
+ if ( ! this . pdfDocument ) {
1349
+ return ;
1350
+ }
1351
+ const markInfo = await this . pdfDocument . getMarkInfo ( ) ;
1352
+ const tagged = markInfo ? markInfo . Marked : false ;
1353
+ this . externalServices . reportTelemetry ( {
1354
+ type : "tagged" ,
1355
+ tagged,
1356
+ } ) ;
1357
+ } ,
1358
+
1338
1359
/**
1339
1360
* @private
1340
1361
*/
You can’t perform that action at this time.
0 commit comments