mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Move the debuggerSrc
-parameter into the AppOptions
Having this parameter among a list of DOM-elements seems slightly strange now, however this is very old code hence the explanation for why this was done is for historical reasons (as is often the case). Hence we can simply move this into `AppOptions` instead, which seems more appropriate overall.
This commit is contained in:
parent
2e2127cbb5
commit
eb36fd375c
3 changed files with 7 additions and 4 deletions
|
@ -2167,11 +2167,10 @@ async function loadFakeWorker() {
|
|||
}
|
||||
|
||||
async function loadPDFBug(self) {
|
||||
const { debuggerScriptPath } = self.appConfig;
|
||||
const { PDFBug } =
|
||||
typeof PDFJSDev === "undefined"
|
||||
? await import(debuggerScriptPath) // eslint-disable-line no-unsanitized/method
|
||||
: await __non_webpack_import__(debuggerScriptPath);
|
||||
? await import(AppOptions.get("debuggerSrc")) // eslint-disable-line no-unsanitized/method
|
||||
: await __non_webpack_import__(AppOptions.get("debuggerSrc"));
|
||||
|
||||
self._PDFBug = PDFBug;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,11 @@ const defaultOptions = {
|
|||
value: 0,
|
||||
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||
},
|
||||
debuggerSrc: {
|
||||
/** @type {string} */
|
||||
value: "./debugger.mjs",
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
defaultZoomDelay: {
|
||||
/** @type {number} */
|
||||
value: 400,
|
||||
|
|
|
@ -177,7 +177,6 @@ function getViewerConfiguration() {
|
|||
),
|
||||
},
|
||||
printContainer: document.getElementById("printContainer"),
|
||||
debuggerScriptPath: "./debugger.mjs",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue