App Visibility     

Quasar makes use of the Web Page Visibility API which lets you know when a website/app is visible or in focus.


Edit /quasar.conf.js:

framework: {
plugins: ['AppVisibility']

Basic Usage

// outside of a Vue file
import { AppVisibility } from 'quasar'

(Boolean) AppVisibility.appVisible

// inside of a Vue file
(Boolean) this.$q.appVisible


Watching for browser tab / app visibility changes:

// vue file

export default {
watch: {
'$q.appVisible' (val) {
console.log(val ? 'App has focus now' : 'App lost focus (was minimized')