mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
[api-minor] Remove the separate enableScripting
option in BaseViewer
Prior to PR 13042, when scripting wasn't really possible to use outside of the full viewer, the `enableScripting` option made sense. However, at this point in time having to both pass in a `PDFScriptingManager`-instance *and* set the `enableScripting`-boolean when creating a `BaseViewer`-instance feels redundant and (mostly) annoying. Hence this patch, which removes the *separate* boolean and always enables scripting when `scriptingManager` is provided. The relevant "viewer component" examples are also updated (with a comment), but in such a way that scripting support won't just break when used with the current PDF.js releases.
This commit is contained in:
parent
4ad5c5d52a
commit
76c805f83b
4 changed files with 13 additions and 14 deletions
|
@ -505,7 +505,8 @@ const PDFViewerApplication = {
|
|||
linkService: pdfLinkService,
|
||||
downloadManager,
|
||||
findController,
|
||||
scriptingManager: pdfScriptingManager,
|
||||
scriptingManager:
|
||||
AppOptions.get("enableScripting") && pdfScriptingManager,
|
||||
renderer: AppOptions.get("renderer"),
|
||||
l10n: this.l10n,
|
||||
textLayerMode: AppOptions.get("textLayerMode"),
|
||||
|
@ -514,7 +515,6 @@ const PDFViewerApplication = {
|
|||
enablePrintAutoRotate: AppOptions.get("enablePrintAutoRotate"),
|
||||
useOnlyCssZoom: AppOptions.get("useOnlyCssZoom"),
|
||||
maxCanvasPixels: AppOptions.get("maxCanvasPixels"),
|
||||
enableScripting: AppOptions.get("enableScripting"),
|
||||
});
|
||||
pdfRenderingQueue.setViewer(this.pdfViewer);
|
||||
pdfLinkService.setViewer(this.pdfViewer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue