-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#pageN anchor not working on first page load #11499
Comments
The hash needs to read |
Thanks for the fast reply! Yes, it works for me, too, with the equals sign. However, it’s still inconsistent: the short version ( |
Yes, however that format shouldn't actually be working at all :-) |
OK, thanks. Maybe this issue can be repurposed to track the removal of this undocumented feature from PDF.js? If not, feel free to close it. |
That was my intention, but some quick debugging would suggest that there's no bug in PDF.js and rather that the browser itself is somehow "helpfully" interpreting those incorrect hashes. I'm thoroughly confused now... Edit: And it even works the exact same way in the |
I found out what happens: |
That property is only used in a JavaScript object, and not actually appended to the DOM.
That would end up "fighting" with the general PDF.js navigation, as you suspected, and there's also the issue of that only working for loaded/rendered pages. Anyway, thanks for helping out with getting to the bottom of all of this! |
Attach (recommended) or Link to PDF file here: https://epa.oszk.hu/00800/00861/00032/pdf/02_kristo.pdf#page2
Configuration:
Steps to reproduce the problem:
What is the expected behavior?
The PDF opens with page 2.
What went wrong?
The PDF opens with page 1.
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): N/A
Additional details:
The function works after page load (when I enter a different anchor name in the URL bar, Firefox goes straight there, without reloading the page; that’s OK). When the anchor is present in the URL on page load, the following error pops up on the browser console:
(the line number is 6507 in v2.2.178, otherwise the same error message). No further stack trace is provided.
The text was updated successfully, but these errors were encountered: