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

Use User-Agent string to detect JSDOM environment #255

Closed
tidoust opened this issue May 4, 2018 · 0 comments
Closed

Use User-Agent string to detect JSDOM environment #255

tidoust opened this issue May 4, 2018 · 0 comments

Comments

@tidoust
Copy link
Member

tidoust commented May 4, 2018

See comment in #252 (comment)

Use of _ properties and of window.name is not the right way to detect the JSDOM environment. The User-Agent string should rather be used.

Note we need to detect JSDOM for 2 reasons:

  1. not to run the Details element polyfill, which triggers some error in JSDOM for some reason. The polyfill is needed right now because the element is not yet supported in Edge.
  2. to apply specific date translation logic as localization of dates (at least in Chinese) does not seem to work in JSDOM

We may be able to get rid of 2 through #253. And we should be able to get rid of 1 once Edge supports the details element

@tidoust tidoust changed the title Use Use-Agent string to detect JSDOM environment Use User-Agent string to detect JSDOM environment May 6, 2018
tidoust added a commit to tidoust/media-web-roadmap that referenced this issue May 6, 2018
Fix for w3c#255

Also stick to `indexOf` instead of `includes` in case people are looking at the
roadmap using IE (but keep `includes` in the generation logic since it should
only run on modern user-agents)
@xfq xfq closed this as completed in 102b330 May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant