Skip to content
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

[Bug]: Auto-linking breaks when page is scrolled into view during searching #19465

Closed
Snuffleupagus opened this issue Feb 10, 2025 · 1 comment · Fixed by #19576
Closed

[Bug]: Auto-linking breaks when page is scrolled into view during searching #19465

Snuffleupagus opened this issue Feb 10, 2025 · 1 comment · Fixed by #19576
Assignees

Comments

@Snuffleupagus
Copy link
Collaborator

Attach (recommended) or Link to PDF file

https://github.com/mozilla/pdf.js/blob/master/test/pdfs/issue3115r.pdf.link

Web browser and its version

N/A

Operating system and its version

N/A

PDF.js version

master, or any version after PR #19110

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Load http://localhost:8888/web/viewer.html?file=/test/pdfs/issue3115r.pdf#disableHistory=true
  2. Open the findbar.
  3. Search for the string rich.edu.

What is the expected behavior?

That auto-linking works as expected on page 22 (36 of 171).

What went wrong?

Auto-linking breaks, with the following error:

renderView: DOMException: Index or size is negative or greater than the allowed amount
    createLinkAnnotation http://localhost:8888/web/autolinker.js:78
    processLinks http://localhost:8888/web/autolinker.js:132
    processLinks http://localhost:8888/web/autolinker.js:132
    resultPromise http://localhost:8888/web/pdf_page_view.js:1117
    draw http://localhost:8888/web/pdf_page_view.js:1099
    renderView http://localhost:8888/web/pdf_rendering_queue.js:196
    forceRendering http://localhost:8888/web/pdf_viewer.js:1849
    promise callback*forceRendering http://localhost:8888/web/pdf_viewer.js:1848
    renderHighestPriority http://localhost:8888/web/pdf_rendering_queue.js:79
    update http://localhost:8888/web/pdf_viewer.js:1677
    _scrollUpdate http://localhost:8888/web/pdf_viewer.js:1239
    viewAreaElementScrolled http://localhost:8888/web/ui_utils.js:153
    debounceScroll http://localhost:8888/web/ui_utils.js:138
    watchScroll http://localhost:8888/web/ui_utils.js:166
    PDFViewer http://localhost:8888/web/pdf_viewer.js:355
    _initializeViewerComponents http://localhost:8888/web/app.js:473
    initialize http://localhost:8888/web/app.js:257
    run http://localhost:8888/web/app.js:704
    webViewerLoad http://localhost:8888/web/viewer.js:294
    <anonymous> http://localhost:8888/web/viewer.js:305
pdf_rendering_queue.js:204:21

Link to a viewer

No response

Additional context

No response

@Snuffleupagus
Copy link
Collaborator Author

Given that auto-linking is enabled by default in Firefox starting with version 137, it would probably be ideal if this issue could be fixed before the 138 development cycle starts to avoid having to uplift patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants