mirror of
https://github.com/videojs/video.js.git
synced 2025-07-13 01:30:17 +02:00
feat(browser): include iOS Chrome UA pattern when detecting Google Chrome (#5262)
Make IS_CHROME return true and IS_ANY_SAFARI return false for iOS Chrome.
This commit is contained in:
committed by
Gary Katsevman
parent
ceed382222
commit
b430461335
@ -59,12 +59,12 @@ export const IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebki
|
||||
|
||||
export const IS_FIREFOX = (/Firefox/i).test(USER_AGENT);
|
||||
export const IS_EDGE = (/Edge/i).test(USER_AGENT);
|
||||
export const IS_CHROME = !IS_EDGE && (/Chrome/i).test(USER_AGENT);
|
||||
export const IS_CHROME = !IS_EDGE && ((/Chrome/i).test(USER_AGENT) || (/CriOS/i).test(USER_AGENT));
|
||||
export const CHROME_VERSION = (function() {
|
||||
const match = USER_AGENT.match(/Chrome\/(\d+)/);
|
||||
const match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);
|
||||
|
||||
if (match && match[1]) {
|
||||
return parseFloat(match[1]);
|
||||
if (match && match[2]) {
|
||||
return parseFloat(match[2]);
|
||||
}
|
||||
return null;
|
||||
}());
|
||||
@ -81,7 +81,7 @@ export const IE_VERSION = (function() {
|
||||
}());
|
||||
|
||||
export const IS_SAFARI = (/Safari/i).test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;
|
||||
export const IS_ANY_SAFARI = IS_SAFARI || IS_IOS;
|
||||
export const IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;
|
||||
|
||||
export const TOUCH_ENABLED = Dom.isReal() && (
|
||||
'ontouchstart' in window ||
|
||||
|
Reference in New Issue
Block a user