ohzi-core 10.6.8 → 10.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.module.js +1 -1
- package/build/index.module.js.map +1 -1
- package/package.json +1 -1
- package/src/Browser.js +2 -13
package/package.json
CHANGED
package/src/Browser.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
class Browser
|
|
3
3
|
{
|
|
4
|
-
init()
|
|
4
|
+
async init()
|
|
5
5
|
{
|
|
6
6
|
this.browser_name = '';
|
|
7
7
|
this.agent = window.navigator.userAgent.toLowerCase();
|
|
8
8
|
|
|
9
|
-
// vr specific
|
|
10
|
-
this.vr_browser_keywords = ['oculusbrowser', 'oculus', 'vive', 'rift', 'windowsmr', 'cardboard', 'daydream', 'wolvic'];
|
|
11
|
-
this.vr_browser_name = this.vr_browser_keywords.find(keyword => this.agent.includes(keyword));
|
|
12
|
-
// Check for WebXR support (indicating VR capabilities)
|
|
13
9
|
this.has_web_xr_support = 'xr' in navigator;
|
|
10
|
+
this.is_vr = this.has_web_xr_support && await navigator.xr.isSessionSupported('immersive-vr');
|
|
14
11
|
|
|
15
12
|
switch (true)
|
|
16
13
|
{
|
|
17
|
-
case this.vr_browser_name !== undefined && this.has_web_xr_support:
|
|
18
|
-
this.browser_name = this.vr_browser_name;
|
|
19
|
-
break;
|
|
20
14
|
case this.agent.indexOf('edge') > -1:
|
|
21
15
|
this.browser_name = 'edge_ie';
|
|
22
16
|
break;
|
|
@@ -71,11 +65,6 @@ class Browser
|
|
|
71
65
|
return this.browser_name === 'edge_chromium';
|
|
72
66
|
}
|
|
73
67
|
|
|
74
|
-
get is_vr()
|
|
75
|
-
{
|
|
76
|
-
return this.vr_browser_keywords.includes(this.browser_name);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
68
|
get has_webm()
|
|
80
69
|
{
|
|
81
70
|
return !!(this.is_chrome || this.is_firefox || this.is_edge_chromium);
|