Переглянути джерело

Add Utils.deviceInfo()

customisations
alemart 1 рік тому
джерело
коміт
9faa9deeff
1 змінених файлів з 16 додано та 0 видалено
  1. 16
    0
      src/utils/utils.ts

+ 16
- 0
src/utils/utils.ts Переглянути файл

@@ -161,4 +161,20 @@ export class Utils
161 161
         // not WebKit
162 162
         return false;
163 163
     }
164
+
165
+    /**
166
+     * Device-specific information for debugging purposes
167
+     */
168
+    static deviceInfo(): string
169
+    {
170
+        return JSON.stringify({
171
+            isIOS: Utils.isIOS(),
172
+            isWebKit: Utils.isWebKit(),
173
+            renderer: Speedy.Platform.renderer,
174
+            vendor: Speedy.Platform.vendor,
175
+            screen: [screen.width, screen.height].toString(),
176
+            userAgent: navigator.userAgent,
177
+            platform: [Utils.platformString(), navigator.platform, navigator.vendor],
178
+        }, null, 4);
179
+    }
164 180
 }

Завантаження…
Відмінити
Зберегти