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

Chrome Violation: Non-passive scroll handlers #4432

Closed
tommyh opened this issue Jun 21, 2017 · 0 comments · Fixed by #4440
Closed

Chrome Violation: Non-passive scroll handlers #4432

tommyh opened this issue Jun 21, 2017 · 0 comments · Fixed by #4440

Comments

@tommyh
Copy link

tommyh commented Jun 21, 2017

Description

Chrome is logging "Violations" for videojs's scroll handlers.

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.
external_embed-b5b3e31….js:936
[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive.

Related Links:
https://developers.google.com/web/updates/2016/06/passive-event-listeners
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support

Steps to reproduce

  1. Open Chrome and dev tools
  2. Set console level to "Verbose"
  3. Go to http://videojs.com
  4. Look in the console for "Violation" warnings.

Results

Expected

Videojs should add passive: true when adding event listeners, so Chrome (and others) can be more performant. The Violation warnings should go away as well.

Actual

Violation warnings in the dev tools console.

Additional Information

versions

videojs

5.19.2

browsers

Chrome Version 59.0.3071.109 (Official Build) (64-bit)

OSes

I tested on mac

plugins

No

gkatsev pushed a commit that referenced this issue Jun 28, 2017
If passive event listening is supported, we should use it.

Fixes #4432.
gkatsev pushed a commit that referenced this issue Jul 4, 2017
If passive event listening is supported, we should use it.

5.x version of #4440.

Fixes #4432.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant