238 lines
No EOL
6.4 KiB
JSON
238 lines
No EOL
6.4 KiB
JSON
{
|
|
"type": "plugin",
|
|
"meta": {
|
|
"docsUrl": "https://v2.quasar.dev/options/platform-detection"
|
|
},
|
|
"injection": "$q.platform",
|
|
"props": {
|
|
"userAgent": {
|
|
"type": "String",
|
|
"desc": "Client browser User Agent",
|
|
"examples": [
|
|
"mozilla/5.0 (macintosh; intel mac os x 10_14_5) applewebkit/537.36 (khtml, like gecko) chrome/75.0.3770.100 safari/537.36"
|
|
]
|
|
},
|
|
"is": {
|
|
"type": "Object",
|
|
"desc": "Client browser details (property names depend on browser)",
|
|
"definition": {
|
|
"name": {
|
|
"type": "String",
|
|
"desc": "Browser name",
|
|
"examples": [
|
|
"chrome"
|
|
]
|
|
},
|
|
"platform": {
|
|
"type": "String",
|
|
"desc": "Platform name",
|
|
"examples": [
|
|
"mac"
|
|
]
|
|
},
|
|
"version": {
|
|
"type": "String",
|
|
"required": false,
|
|
"desc": "Detailed browser version",
|
|
"examples": [
|
|
"71.0.3578.98"
|
|
]
|
|
},
|
|
"versionNumber": {
|
|
"type": "Number",
|
|
"required": false,
|
|
"desc": "Major browser version as a number"
|
|
},
|
|
"desktop": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is desktop"
|
|
},
|
|
"mobile": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is mobile"
|
|
},
|
|
"electron": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is Electron"
|
|
},
|
|
"bex": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is BEX(Browser Extension)"
|
|
},
|
|
"capacitor": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is Capacitor"
|
|
},
|
|
"cordova": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is Cordova"
|
|
},
|
|
"nativeMobile": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the platform is a native mobile wrapper"
|
|
},
|
|
"nativeMobileWrapper": {
|
|
"type": "String",
|
|
"required": false,
|
|
"values": [
|
|
"cordova",
|
|
"capacitor"
|
|
],
|
|
"desc": "Type of the native mobile wrapper"
|
|
},
|
|
"chrome": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Google Chrome"
|
|
},
|
|
"firefox": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Firefox"
|
|
},
|
|
"safari": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Safari"
|
|
},
|
|
"edgeChromium": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Microsoft Edge (Chromium)"
|
|
},
|
|
"edge": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Microsoft Edge Legacy"
|
|
},
|
|
"opera": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Opera"
|
|
},
|
|
"vivaldi": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Vivaldi"
|
|
},
|
|
"win": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Windows"
|
|
},
|
|
"linux": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Linux"
|
|
},
|
|
"mac": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Mac OS"
|
|
},
|
|
"cros": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Chrome OS"
|
|
},
|
|
"android": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Android"
|
|
},
|
|
"ios": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is iOS"
|
|
},
|
|
"winphone": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the operating system is Windows Phone"
|
|
},
|
|
"iphone": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the device is an iPhone"
|
|
},
|
|
"ipad": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the device is an iPad"
|
|
},
|
|
"ipod": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the device is an iPod"
|
|
},
|
|
"kindle": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the device is a Kindle"
|
|
},
|
|
"silk": {
|
|
"type": "Boolean",
|
|
"required": false,
|
|
"desc": "Whether the browser is Amazon Silk"
|
|
}
|
|
},
|
|
"examples": [
|
|
"{ chrome: true, version: '71.0.3578.98', versionNumber: 71, mac: true, desktop: true, webkit: true, name: 'chrome', platform: 'mac' }"
|
|
]
|
|
},
|
|
"has": {
|
|
"type": "Object",
|
|
"desc": "Client browser detectable properties",
|
|
"definition": {
|
|
"touch": {
|
|
"type": "Boolean",
|
|
"desc": "Client browser runs on device with touch support"
|
|
},
|
|
"webStorage": {
|
|
"type": "Boolean",
|
|
"desc": "Client browser has Web Storage support"
|
|
}
|
|
},
|
|
"examples": [
|
|
"{ touch: false, webStorage: true }"
|
|
]
|
|
},
|
|
"within": {
|
|
"type": "Object",
|
|
"desc": "Client browser environment",
|
|
"definition": {
|
|
"iframe": {
|
|
"type": "Boolean",
|
|
"desc": "Does the app run under an iframe?"
|
|
}
|
|
},
|
|
"examples": [
|
|
"{ iframe: false }"
|
|
]
|
|
}
|
|
},
|
|
"methods": {
|
|
"parseSSR": {
|
|
"desc": "For SSR usage only, and only on the global import (not on $q.platform)",
|
|
"params": {
|
|
"ssrContext": {
|
|
"type": "Object",
|
|
"desc": "SSR Context Object",
|
|
"required": true
|
|
}
|
|
},
|
|
"returns": {
|
|
"type": "Object",
|
|
"tsType": "Platform",
|
|
"desc": "Platform object (like $q.platform) for SSR usage purposes"
|
|
}
|
|
}
|
|
}
|
|
} |