Remove the enableScripting option from the PDFPageView constructor

Scripting, as implemented, requires access to a complete document/viewer in order to work. Hence it doesn't really make sense to keep the `enableScripting`-option on `PDFPageView`-instances.[1]

---
[1] Note that there's the `PDFSinglePageViewer`, which can be used in cases where you want access to all features/functionality of the viewer but only display *one* page at a time.
This commit is contained in:
Jonas Jenwald 2021-04-09 14:20:47 +02:00
parent 6429ccc002
commit ec9e29807a
2 changed files with 3 additions and 7 deletions

View file

@ -552,7 +552,6 @@ class BaseViewer {
useOnlyCssZoom: this.useOnlyCssZoom,
maxCanvasPixels: this.maxCanvasPixels,
l10n: this.l10n,
enableScripting: this.enableScripting,
});
this._pages.push(pageView);
}
@ -1296,7 +1295,7 @@ class BaseViewer {
imageResourcesPath = "",
renderInteractiveForms = false,
l10n = NullL10n,
enableScripting = false,
enableScripting = null,
hasJSActionsPromise = null,
mouseState = null
) {
@ -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,