mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-03 12:57:20 +02:00
Merge pull request #20936 from Snuffleupagus/debugger-getPageIndex
[Debugger] Allow debugging page-rendering from the /Ref, in addition to the page number
This commit is contained in:
commit
b6c9b12de0
@ -230,6 +230,15 @@ gotoInput.addEventListener("keydown", async ({ key, target }) => {
|
||||
return;
|
||||
}
|
||||
target.removeAttribute("aria-invalid");
|
||||
|
||||
// Allow debugging via references, as well as page numbers.
|
||||
if (result.page === undefined) {
|
||||
try {
|
||||
result.page =
|
||||
pdfDoc.cachedPageNumber(result.ref) ??
|
||||
(await pdfDoc.getPageIndex(result.ref)) + 1;
|
||||
} catch {}
|
||||
}
|
||||
// If we're in debug view and navigating to a page, stay in debug view
|
||||
// without switching to the tree at all.
|
||||
if (!debugViewEl.hidden && result.page !== undefined) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user