Skip to content

Instantly share code, notes, and snippets.

@daybrush
Created September 2, 2020 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daybrush/5007805e51c9cb8e42521af9085af6d3 to your computer and use it in GitHub Desktop.
Save daybrush/5007805e51c9cb8e42521af9085af6d3 to your computer and use it in GitHub Desktop.
import { getAccurateAgent } from "@egjs/agent";
// Use Promise
getAccurateAgent().then(agent => {
// Mac OS X 10.15.4, Chrome Canary 87.0.4243.0
// "chrome"
agent.browser.name
// "87.0.4243.0"
agent.browser.version
// "mac"
agent.os.name
// "10.15.4"
agent.os.version
});
// Use Callback
getAccurateAgent(agent => {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment