mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
web/lib/device: add webkit browser detection
This commit is contained in:
parent
4182845e9a
commit
029934e580
@ -16,6 +16,7 @@ const device = {
|
|||||||
},
|
},
|
||||||
browser: {
|
browser: {
|
||||||
chrome: false,
|
chrome: false,
|
||||||
|
webkit: false,
|
||||||
},
|
},
|
||||||
prefers: {
|
prefers: {
|
||||||
language: "en",
|
language: "en",
|
||||||
@ -59,6 +60,12 @@ if (browser) {
|
|||||||
|
|
||||||
device.browser = {
|
device.browser = {
|
||||||
chrome: ua.includes("chrome/"),
|
chrome: ua.includes("chrome/"),
|
||||||
|
webkit: ua.includes("applewebkit/")
|
||||||
|
&& ua.includes("version/")
|
||||||
|
&& ua.includes("safari/")
|
||||||
|
// this is the version of webkit that's hardcoded into chrome
|
||||||
|
// and indicates that the browser is not actually webkit
|
||||||
|
&& !ua.includes("applewebkit/537.36")
|
||||||
};
|
};
|
||||||
|
|
||||||
device.prefers = {
|
device.prefers = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user