Simple plugin for Vue that detects browser name, version, and user-agent.
npm install vue-browser-detect-plugin
In your main.js:
import browserDetect from "vue-browser-detect-plugin";
Vue.use(browserDetect);
-
vm.$browserDetect.isIE
boolean
-
vm.$browserDetect.isChrome
boolean
- Note: This is Chrome desktop.
-
vm.$browserDetect.isFirefox
boolean
-
vm.$browserDetect.isOpera
boolean
-
vm.$browserDetect.isSafari
boolean
-
vm.$browserDetect.isEdge
boolean
-
vm.$browserDetect.isChromeIOS
boolean
-
vm.$browserDetect.isIOS
boolean
-
vm.$browserDetect.meta.name
Chrome, IE, Edge, etc.
-
vm.$browserDetect.meta.version
Version
-
vm.$browserDetect.meta.ua
user-agent
https://vue-browser-detect.netlify.com/
Add vue-browser-detect-plugin/nuxt
to the buildModules
section of nuxt.config.js
export default {
buildModules: [
'vue-browser-detect-plugin/nuxt'
]
}
dependency
(No --dev
or --save-dev
flags) and use modules
section in nuxt.config.js
instead of buildModules
.