Skip to content

Plugin for Vue3 that detects browser name, version, and user-agent

License

Notifications You must be signed in to change notification settings

thomergil/vue3-detect-browser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue3-detect-browser

Plugin (with TypeScript support) for Vue3 that detects browser name, version, and user-agent. This is a fork of https://github.com/smg99/vue-detect-browser.

Installation with npm

npm i vue3-detect-browser

Installation with yarn

yarn add vue3-detect-browser

Option API Usage

In your main.js:

import detectBrowser from "vue-detect-browser";
app.use(detectBrowser);

Browser

In any component file it is available as this.detectBrowser data property

this.detectBrowser.isChrome
this.detectBrowser.isFirefox
this.detectBrowser.isOpera
this.detectBrowser.isSafari
this.detectBrowser.isEdge
this.detectBrowser.isChromeIOS
this.detectBrowser.isIOS
this.detectBrowser.isIE

Composition API Usage

<script setup>
import { useBrowserDetect } from 'vue3-detect-browser';
const { isFirefox, isChrome } = useBrowserDetect();
</script>

About

Plugin for Vue3 that detects browser name, version, and user-agent

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 54.3%
  • JavaScript 45.7%