Created
September 2, 2020 04:38
-
-
Save daybrush/5007805e51c9cb8e42521af9085af6d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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