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

fix: adds workaround for non-spec-compliant userAgentData #8474

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

iamtang
Copy link
Contributor

@iamtang iamtang commented Oct 23, 2023

Description

On some Android phones, 'window. navigator. userAgentData' may be '{}', resulting in IS_ANDROID=UAD. platform==='Android' being false
image

Specific Changes proposed

image

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@welcome
Copy link

welcome bot commented Oct 23, 2023

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #8474 (309b73b) into main (cd2dac4) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #8474   +/-   ##
=======================================
  Coverage   82.71%   82.71%           
=======================================
  Files         113      113           
  Lines        7589     7589           
  Branches     1826     1826           
=======================================
  Hits         6277     6277           
  Misses       1312     1312           
Files Coverage Δ
src/js/utils/browser.js 56.73% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gkatsev
Copy link
Member

gkatsev commented Oct 23, 2023

Seems reasonable to have the check, though, I think those android devices are technically not spec compliant. It doesn't seem like the spec allows userAgentData object to be an empty object.

@mister-ben mister-ben changed the title bugfix: fix window.navigator.userAgentData may be '{}' fix: adds workaround for non-spec-compliant userAgentData Oct 24, 2023
@mister-ben mister-ben merged commit d535e16 into videojs:main Oct 24, 2023
10 checks passed
@welcome
Copy link

welcome bot commented Oct 24, 2023

Congrats on merging your first pull request! 🎉🎉🎉

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

Successfully merging this pull request may close these issues.

4 participants