mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
[api-minor] Add a getDocument
option to disable ImageDecoder
usage
This allows end-users to forcibly disable `ImageDecoder` usage, even if the browser appears to support it (similar to the pre-existing option for `OffscreenCanvas`).
This commit is contained in:
parent
fe5967c84e
commit
65eedfb0fc
6 changed files with 50 additions and 31 deletions
|
@ -48,10 +48,12 @@ class BasePdfManager {
|
|||
this._password = args.password;
|
||||
this.enableXfa = args.enableXfa;
|
||||
|
||||
// Check `OffscreenCanvas` support once, rather than repeatedly throughout
|
||||
// the worker-thread code.
|
||||
// Check `OffscreenCanvas` and `ImageDecoder` support once,
|
||||
// rather than repeatedly throughout the worker-thread code.
|
||||
args.evaluatorOptions.isOffscreenCanvasSupported &&=
|
||||
FeatureTest.isOffscreenCanvasSupported;
|
||||
args.evaluatorOptions.isImageDecoderSupported &&=
|
||||
FeatureTest.isImageDecoderSupported;
|
||||
this.evaluatorOptions = Object.freeze(args.evaluatorOptions);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue