mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-27 05:28:49 +01:00
web/device: add browser type (just chrome for now)
This commit is contained in:
parent
910cbcf236
commit
5fa5a0e7cb
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,9 @@ const device = {
|
||||||
android: false,
|
android: false,
|
||||||
mobile: false,
|
mobile: false,
|
||||||
},
|
},
|
||||||
|
browser: {
|
||||||
|
chrome: false,
|
||||||
|
},
|
||||||
prefers: {
|
prefers: {
|
||||||
language: "en",
|
language: "en",
|
||||||
reducedMotion: false,
|
reducedMotion: false,
|
||||||
|
@ -49,6 +52,10 @@ if (browser) {
|
||||||
mobile: iOS || android,
|
mobile: iOS || android,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
device.browser = {
|
||||||
|
chrome: ua.includes("chrome/"),
|
||||||
|
};
|
||||||
|
|
||||||
device.prefers = {
|
device.prefers = {
|
||||||
language: navigator.language.toLowerCase().slice(0, 2) || "en",
|
language: navigator.language.toLowerCase().slice(0, 2) || "en",
|
||||||
reducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
|
reducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
|
||||||
|
|
Loading…
Reference in a new issue