@cardsjd/device 0.1.10 → 0.1.12
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/lib/device.js +9 -3
- package/package.json +1 -1
package/lib/device.js
CHANGED
|
@@ -74,7 +74,7 @@ export default class Device {
|
|
|
74
74
|
|
|
75
75
|
//Get override information
|
|
76
76
|
const searchParams = new URLSearchParams(window.location.search);
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
//discord has a platform in its url and messes up detection //detect first
|
|
79
79
|
if (window.location.host.includes('discord') || (window.location.href.includes("localhost") && window.location.href.includes("frame_id"))) {
|
|
80
80
|
return 'discord';
|
|
@@ -87,12 +87,18 @@ export default class Device {
|
|
|
87
87
|
|
|
88
88
|
//facebook instant
|
|
89
89
|
if (typeof globalThis.FBInstant !== 'undefined') {
|
|
90
|
-
return '
|
|
90
|
+
return 'facebook';
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
if (typeof globalThis.CrazyGames !== 'undefined') {
|
|
94
94
|
return 'crazygames';
|
|
95
95
|
}
|
|
96
|
+
if (globalThis.location?.ancestorOrigins?.[0]?.includes("crazygames")) {
|
|
97
|
+
return 'crazygames';
|
|
98
|
+
}
|
|
99
|
+
if (globalThis.location?.ancestorOrigins?.[0]?.includes("discord")) {
|
|
100
|
+
return 'discord';
|
|
101
|
+
}
|
|
96
102
|
|
|
97
103
|
//native Cordova
|
|
98
104
|
if (typeof globalThis.cordova !== 'undefined') {
|
|
@@ -137,6 +143,6 @@ export default class Device {
|
|
|
137
143
|
return 'web';
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
/** @typedef {'
|
|
146
|
+
/** @typedef {'facebook' | 'windowsPhone' | 'windows' | 'amazon' | 'android' | 'ios' | 'steam' | 'windowsPWA' | 'web' | 'crazygames'} PlatformType */
|
|
141
147
|
|
|
142
148
|
}
|