Skip to content

Commit 996c17f

Browse files
committed
[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.
1 parent f6df9f1 commit 996c17f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/display/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const RENDERING_CANCELLED_TIMEOUT = 100; // ms
157157
* Use -1 for no limit, which is also the default value.
158158
* @property {boolean} [isEvalSupported] - Determines if we can evaluate strings
159159
* as JavaScript. Primarily used to improve performance of PDF functions.
160-
* The default value is `true`.
160+
* The default value is `false`.
161161
* @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use
162162
* `OffscreenCanvas` in the worker. Primarily used to improve performance of
163163
* image conversion/rendering.
@@ -286,7 +286,7 @@ function getDocument(src = {}) {
286286
Number.isInteger(src.maxImageSize) && src.maxImageSize > -1
287287
? src.maxImageSize
288288
: -1;
289-
const isEvalSupported = src.isEvalSupported !== false;
289+
const isEvalSupported = src.isEvalSupported === true;
290290
const isOffscreenCanvasSupported =
291291
typeof src.isOffscreenCanvasSupported === "boolean"
292292
? src.isOffscreenCanvasSupported

web/app_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ const defaultOptions = {
408408
},
409409
isEvalSupported: {
410410
/** @type {boolean} */
411-
value: true,
411+
value: false,
412412
kind: OptionKind.API,
413413
},
414414
isOffscreenCanvasSupported: {

0 commit comments

Comments
 (0)