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

Ctrl-wheel zooming also scales UI in Chrome #10761

Closed
kuro68k opened this issue Apr 24, 2019 · 8 comments · Fixed by #10765
Closed

Ctrl-wheel zooming also scales UI in Chrome #10761

kuro68k opened this issue Apr 24, 2019 · 8 comments · Fixed by #10765
Labels

Comments

@kuro68k
Copy link

kuro68k commented Apr 24, 2019

Attach (recommended) or Link to PDF file here: Any PDF will work

Configuration:

  • Web browser and its version: Chrome 73.0.3683.103 x64
  • Operating system and its version: Windows 10 Pro x64
  • PDF.js version: 2.0.673
  • Is a browser extension: Yes

Steps to reproduce the problem:

  1. Open any PDF
  2. Hold CTRL key and use mouse wheel to zoom in/out

What is the expected behavior? (add screenshot)

Document is zoomed in/out

What went wrong? (add screenshot)

The PDF reader UI is also scaled. It appears that Chrome is also zooming the entire page, including the PDF reader UI, as well as the PDF reader also zooming the document.

In previous versions only the document would be zoomed.

image

Note how the PDF viewer UI is scaled in this image. It can also be made absurdly small by zooming out:

image

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 24, 2019

In previous versions only the document would be zoomed.

It's not clear what "previous versions" refer to here, but this is actually a case where the Chrome browser itself is unfortunately breaking web compatibility; see https://developers.google.com/web/updates/2019/02/scrolling-intervention for additional details.

Generally speaking this cannot be "fixed", or rather worked-around since it's not our fault, in the PDF.js default viewer since we still support IE11 for the time being, which according to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Browser_compatibility doesn't support the options object format in addEventListener calls.

@kuro68k
Copy link
Author

kuro68k commented Apr 24, 2019

Sorry, previous version of Chrome.

If I understand you are saying that adding {passive: true} would fix it, but you can't do that because it would break Internet Explorer. That's unfortunate as I rate the probability of Google relenting or Microsoft fixing IE11 as 0%.

I will attempt to fork to see if I can fix the problem based on your suggestion. Thank you.

@kuro68k
Copy link
Author

kuro68k commented May 14, 2019

Fork with fix here: https://github.com/kuro68k/pdf.js

@kuro68k
Copy link
Author

kuro68k commented May 28, 2019

I made a fixed version available for Chrome here: https://chrome.google.com/webstore/detail/pdf-viewer/khoagkdmmnmmimpmdbeapnlmkkiiikae

@timvandermeij
Copy link
Contributor

The problem should be fixed by the pull request above and will be in the next release. Maybe a Chrome extension update can already be done (/cc @Rob--W for that)? That way no fork/other extension than the official one should be necessary.

@kuro68k
Copy link
Author

kuro68k commented May 29, 2019

Well, I should be happy it's being fixed at least. I'll pull mine once it's out.

@Rob--W
Copy link
Member

Rob--W commented May 29, 2019

I'll include a fix for #10645 and then publish the update.

@Rob--W
Copy link
Member

Rob--W commented May 30, 2019

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