Skip to content

Commit

Permalink
[api-minor] Disable eval support by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Snuffleupagus committed Mar 5, 2025
1 parent f6df9f1 commit 996c17f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web/app_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ const defaultOptions = {
},
isEvalSupported: {
/** @type {boolean} */
value: true,
value: false,
kind: OptionKind.API,
},
isOffscreenCanvasSupported: {
Expand Down

0 comments on commit 996c17f

Please sign in to comment.