-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
requestAnimationFrame should not monkey patch over window #8908
Comments
But we do check if pdf.js/src/shared/compatibility.js Lines 727 to 735 in d0d7046
Considering that all modern browsers already have
That version of PDF.js is first of all several years old, and secondly it doesn't match any official release as listed in https://github.com/mozilla/pdf.js/releases.
The "Is an extension" question refers to https://github.com/mozilla/pdf.js#browser-extensions. Please note that we cannot support third-party libraries that depend on PDF.js, hence you'll need to ask for support directly from its maintainer.
As indicated above, PDF.js will not replace the native In summary, I'm not convinced that we need/should make any changes here. |
I'm closing this as answered by the comment above. I too see nothing else that should be done here on the PDF.js side. Make sure to use the most recent version of PDF.js since we do check if RAF is supported before polyfilling it. |
Actually on iOS it appears a polyfill is forced. Can you consider reopening this issue?
from pdf.js/src/shared/compatibility.js Lines 571 to 575 in 6521d2f
|
Opened project/proposal at https://github.com/mozilla/pdf.js/projects/6 |
Considering that the |
Yes the problem still exists only on the 1.x branch (another library uses pdf.js 1.x as it's dependency which is where I encountered the issue originally). so assuming that branch is no longer maintained this ticket can remain closed. |
pdf.js anonymously monkey patches over the window.requestAnimationFrame() namespace which doesn't allow the user to unpatch. Register a function with a new name on the window (i.e. Window.prototype.requestAnimFrame) or use a browser patch to check if raf is supported before replacing it with a setTimeout().
Configuration:
What is the expected behavior? To be able to call window.requestAnimationFrame() elsewhere in an application and not have it hijacked by pdf.js's raf patch.
What went wrong?
installFakeAnimationFrameFunctions creates a bad shim for smooth animations, affecting the user experience throughout the application.
My suggestion would be to use Paul Irish's polyfill (which is widely accepted/used)
https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
The text was updated successfully, but these errors were encountered: