hypothesis / client

The Hypothesis web-based annotation client.
Other
642 stars 197 forks source link

Open pdf in Firefox, annotations disappear when zooming in/out #5230

Open function2-llx opened 1 year ago

function2-llx commented 1 year ago

To reproduce

  1. open pdf file (local or remote URL, e.g., https://arxiv.org/pdf/1911.05722.pdf) with Firefox
  2. activate the hypothesis by clicking the bookmark
  3. annotate some text
  4. zoom the page (by holding ctrl and scrolling, or clicking the "+/-" button on the top), then the annotations disappear, though they still exist and are clickable

out

I've tested with via.hypothes.is and Chrome, and both work fine, the annotations disappear when zooming but appear again instantly.

OS: Ubuntu 22.04 Firefox version: 109.0.1 (64-bit)

robertknight commented 1 year ago

I can reproduce when using the Hypothesis bookmarklet in Firefox 109.0.1, which uses PDF.js v3.2.47 [feb6f5951] (see console logs). I cannot reproduce in the same browser when accessing the PDF through Via, which is currently using PDF.js v2.14.137.

So it looks like the issue is related to changes in PDF.js.

function2-llx commented 1 year ago

Hello, will Hypothesis become compatible with PDF.js of higher versions in the future? It seems non-trivial to use a lower version of PDF.js in Firefox (https://github.com/mozilla/pdf.js/issues/10500).

robertknight commented 1 year ago

Hello, will Hypothesis become compatible with PDF.js of higher versions in the future?

Eventually, yes. We have other work that is a higher priority for us at present.

Most annotation of PDFs with Hypothesis is done via the Chrome extension, the proxy service at https://via.hypothes.is or the custom PDF.js viewer at https://github.com/hypothesis/pdf.js-hypothes.is. In all of those cases we control the version of PDF.js that is used, so we make sure it is compatible with the client.