Commit 54a8c04
committed
Prevent
Given that extracting all text can take a while to complete, especially in long PDF documents[1], it's technically possible for the user to "select all", copy, and finally abort copying (with the `Esc` key) while `PdfTextExtractor.prototype.extractTextContent` is still running.
If that happens the `PDFViewer.prototype.getAllText` code would be interrupted, and text-extraction would thus fail in an intermittent and (likely) hard to debug way. To avoid this we replace the current "global" interrupt handling with an optional `AbortSignal` instead.
---
[1] See e.g. `pdf.pdf` in the test-suite.PdfTextExtractor.prototype.extractTextContent from failing intermittently1 parent d859d78 commit 54a8c04
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
277 | 275 | | |
278 | 276 | | |
279 | 277 | | |
| |||
771 | 769 | | |
772 | 770 | | |
773 | 771 | | |
774 | | - | |
| 772 | + | |
775 | 773 | | |
776 | 774 | | |
777 | 775 | | |
778 | 776 | | |
779 | 777 | | |
780 | 778 | | |
781 | 779 | | |
782 | | - | |
| 780 | + | |
783 | 781 | | |
784 | 782 | | |
785 | 783 | | |
| |||
833 | 831 | | |
834 | 832 | | |
835 | 833 | | |
836 | | - | |
| 834 | + | |
| 835 | + | |
837 | 836 | | |
838 | 837 | | |
839 | | - | |
840 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
841 | 844 | | |
842 | 845 | | |
843 | | - | |
| 846 | + | |
844 | 847 | | |
845 | 848 | | |
846 | 849 | | |
| |||
853 | 856 | | |
854 | 857 | | |
855 | 858 | | |
856 | | - | |
857 | | - | |
| 859 | + | |
858 | 860 | | |
859 | 861 | | |
860 | 862 | | |
| |||
0 commit comments