Merge pull request #3231 from emilrowland/bug/oculus

fix: Oculus browser is no longer marked as TV
This commit is contained in:
Bill Thornton 2021-12-27 10:41:27 -05:00 committed by GitHub
commit aeb357ca14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,11 @@ function isTv() {
// This is going to be really difficult to get right // This is going to be really difficult to get right
const userAgent = navigator.userAgent.toLowerCase(); const userAgent = navigator.userAgent.toLowerCase();
// The OculusBrowsers userAgent also has the samsungbrowser defined but is not a tv.
if (userAgent.indexOf('oculusbrowser') !== -1) {
return false;
}
if (userAgent.indexOf('tv') !== -1) { if (userAgent.indexOf('tv') !== -1) {
return true; return true;
} }