Skip to content

Commit

Permalink
Merge pull request #13209 from Snuffleupagus/rm-PDFPageView-enableScr…
Browse files Browse the repository at this point in the history
…ipting

Remove the `enableScripting` option from the `PDFPageView` constructor
  • Loading branch information
timvandermeij committed Apr 9, 2021
2 parents acb5c50 + ec9e298 commit 0ae5a6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions web/base_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ class BaseViewer {
useOnlyCssZoom: this.useOnlyCssZoom,
maxCanvasPixels: this.maxCanvasPixels,
l10n: this.l10n,
enableScripting: this.enableScripting,
});
this._pages.push(pageView);
}
Expand Down Expand Up @@ -1296,7 +1295,7 @@ class BaseViewer {
imageResourcesPath = "",
renderInteractiveForms = false,
l10n = NullL10n,
enableScripting = false,
enableScripting = null,
hasJSActionsPromise = null,
mouseState = null
) {
Expand All @@ -1310,7 +1309,7 @@ class BaseViewer {
linkService: this.linkService,
downloadManager: this.downloadManager,
l10n,
enableScripting,
enableScripting: enableScripting ?? this.enableScripting,
hasJSActionsPromise:
hasJSActionsPromise || this.pdfDocument?.hasJSActions(),
mouseState: mouseState || this._scriptingManager?.mouseState,
Expand Down
5 changes: 1 addition & 4 deletions web/pdf_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ import { viewerCompatibilityParams } from "./viewer_compatibility.js";
* total pixels, i.e. width * height. Use -1 for no limit. The default value
* is 4096 * 4096 (16 mega-pixels).
* @property {IL10n} l10n - Localization service.
* @property {boolean} [enableScripting] - Enable embedded script execution.
* The default value is `false`.
*/

const MAX_CANVAS_PIXELS = viewerCompatibilityParams.maxCanvasPixels || 16777216;
Expand Down Expand Up @@ -107,7 +105,6 @@ class PDFPageView {
this.renderer = options.renderer || RendererType.CANVAS;
this.enableWebGL = options.enableWebGL || false;
this.l10n = options.l10n || NullL10n;
this.enableScripting = options.enableScripting === true;

this.paintTask = null;
this.paintedViewportMap = new WeakMap();
Expand Down Expand Up @@ -584,7 +581,7 @@ class PDFPageView {
this.imageResourcesPath,
this.renderInteractiveForms,
this.l10n,
this.enableScripting,
/* enableScripting */ null,
/* hasJSActionsPromise = */ null,
/* mouseState = */ null
);
Expand Down

0 comments on commit 0ae5a6e

Please sign in to comment.