From 996c17f750a8840626f61b97a2b673e6c47e1366 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 6 Feb 2025 09:09:29 +0100 Subject: [PATCH] [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. --- src/display/api.js | 4 ++-- web/app_options.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index 0ca74fe8e4aaa..0b4a7d0228718 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -157,7 +157,7 @@ const RENDERING_CANCELLED_TIMEOUT = 100; // ms * Use -1 for no limit, which is also the default value. * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings * 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 * `OffscreenCanvas` in the worker. Primarily used to improve performance of * image conversion/rendering. @@ -286,7 +286,7 @@ function getDocument(src = {}) { Number.isInteger(src.maxImageSize) && src.maxImageSize > -1 ? src.maxImageSize : -1; - const isEvalSupported = src.isEvalSupported !== false; + const isEvalSupported = src.isEvalSupported === true; const isOffscreenCanvasSupported = typeof src.isOffscreenCanvasSupported === "boolean" ? src.isOffscreenCanvasSupported diff --git a/web/app_options.js b/web/app_options.js index 6a671aa809b23..3cbf942be7299 100644 --- a/web/app_options.js +++ b/web/app_options.js @@ -408,7 +408,7 @@ const defaultOptions = { }, isEvalSupported: { /** @type {boolean} */ - value: true, + value: false, kind: OptionKind.API, }, isOffscreenCanvasSupported: {