Skip to content

Commit

Permalink
Merge pull request #17593 from Snuffleupagus/debuggerSrc-AppOptions
Browse files Browse the repository at this point in the history
Move the `debuggerSrc`-parameter into the `AppOptions`
  • Loading branch information
Snuffleupagus authored Jan 28, 2024
2 parents 2e2127c + eb36fd3 commit 802f702
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions web/app_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ function getViewerConfiguration() {
),
},
printContainer: document.getElementById("printContainer"),
debuggerScriptPath: "./debugger.mjs",
};
}

Expand Down

0 comments on commit 802f702

Please sign in to comment.