-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Description
I'm displaying a progress bar on document loading with a Cancel button to give a chance to the user to abort the download. If I understood correctly based on #6546 calling destroy() on the loading task is the correct way to do it. But that throws an exception in the worker what I even not able to catch anywhere.
Configuration:
- Web browser and its version: Chrome 80.0.3987, Safari 13.0.5 (15608.5.11)
- Operating system and its version: MacOS 10.15.3
- PDF.js version: v2.3.200 (same in 2.2.228)
- Is a browser extension: no
Steps to reproduce the problem:
- Call loadingTask.destroy() before getDocument resolves
What is the expected behavior? (add screenshot)
Worker should stop without exception
What went wrong? (add screenshot)
Try https://jsfiddle.net/zmagyar/uLnqk1m5/1/#
Console says:
(index):76 Error: Worker was destroyed
at terminateEarly (api.js:1781)
at api.js:1827
at Worker.MessageHandler._onComObjOnMessage (message_handler.js:147)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels