mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-26 08:57:21 +02:00
[api-minor] Disable eval support by default
The idea behind this patch is to see if disabling of `eval` leads to any reports about bad performance, since the previous patch should have improved things a fair bit.
This commit is contained in:
parent
f7ec74c474
commit
602824ba0f
@ -159,7 +159,7 @@ const RENDERING_CANCELLED_TIMEOUT = 100; // ms
|
|||||||
* Use -1 for no limit, which is also the default value.
|
* Use -1 for no limit, which is also the default value.
|
||||||
* @property {boolean} [isEvalSupported] - Determines if we can evaluate strings
|
* @property {boolean} [isEvalSupported] - Determines if we can evaluate strings
|
||||||
* as JavaScript. Primarily used to improve performance of PDF functions.
|
* as JavaScript. Primarily used to improve performance of PDF functions.
|
||||||
* The default value is `true`.
|
* The default value is `false`.
|
||||||
* @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
|
* @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
|
||||||
* `OffscreenCanvas` in the worker. Primarily used to improve performance of
|
* `OffscreenCanvas` in the worker. Primarily used to improve performance of
|
||||||
* image conversion/rendering.
|
* image conversion/rendering.
|
||||||
@ -289,7 +289,7 @@ function getDocument(src = {}) {
|
|||||||
Number.isInteger(src.maxImageSize) && src.maxImageSize > -1
|
Number.isInteger(src.maxImageSize) && src.maxImageSize > -1
|
||||||
? src.maxImageSize
|
? src.maxImageSize
|
||||||
: -1;
|
: -1;
|
||||||
const isEvalSupported = src.isEvalSupported !== false;
|
const isEvalSupported = src.isEvalSupported === true;
|
||||||
const isOffscreenCanvasSupported =
|
const isOffscreenCanvasSupported =
|
||||||
typeof src.isOffscreenCanvasSupported === "boolean"
|
typeof src.isOffscreenCanvasSupported === "boolean"
|
||||||
? src.isOffscreenCanvasSupported
|
? src.isOffscreenCanvasSupported
|
||||||
|
|||||||
@ -419,7 +419,7 @@ const defaultOptions = {
|
|||||||
},
|
},
|
||||||
isEvalSupported: {
|
isEvalSupported: {
|
||||||
/** @type {boolean} */
|
/** @type {boolean} */
|
||||||
value: true,
|
value: false,
|
||||||
kind: OptionKind.API,
|
kind: OptionKind.API,
|
||||||
},
|
},
|
||||||
isOffscreenCanvasSupported: {
|
isOffscreenCanvasSupported: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user