Browse Source

Add comments

customisations
alemart 1 year ago
parent
commit
b92b5a9cad
1 changed files with 14 additions and 2 deletions
  1. 14
    2
      src/core/session.ts

+ 14
- 2
src/core/session.ts View File

188
      */
188
      */
189
     static isSupported(): boolean
189
     static isSupported(): boolean
190
     {
190
     {
191
-        // If Safari or iOS, require version 15.2 or later
191
+        //alert(Utils.deviceInfo()); // debug
192
+
193
+        // If Safari / iOS, require version 15.2 or later
192
         if(/(Mac|iOS|iPhone|iPad|iPod)/i.test(Utils.platformString())) {
194
         if(/(Mac|iOS|iPhone|iPad|iPod)/i.test(Utils.platformString())) {
193
 
195
 
194
             /*
196
             /*
226
 
228
 
227
             if(matches !== null) {
229
             if(matches !== null) {
228
                 const version = matches[3] || '0.0';
230
                 const version = matches[3] || '0.0';
229
-                const [x, y] = version.split(/[\._]/).map(v => parseInt(v));
231
+                const [x, y] = version.split(/[\._]/).map(v => parseInt(v) | 0);
230
 
232
 
231
                 if((x < 15) || (x == 15 && y < 2)) {
233
                 if((x < 15) || (x == 15 && y < 2)) {
232
                     Utils.error(`${matches === safari ? 'Safari' : 'iOS'} version ${version} is not supported! User agent: ${navigator.userAgent}`);
234
                     Utils.error(`${matches === safari ? 'Safari' : 'iOS'} version ${version} is not supported! User agent: ${navigator.userAgent}`);
233
                     return false;
235
                     return false;
234
                 }
236
                 }
237
+
238
+                // XXX reject older iPhone models? Which ones?
239
+                /*if(navigator.userAgent.includes('iPhone')) {
240
+                    // detect screen size?
241
+                }*/
235
             }
242
             }
236
             else
243
             else
237
                 Utils.warning(`Unrecognized user agent: ${navigator.userAgent}`);
244
                 Utils.warning(`Unrecognized user agent: ${navigator.userAgent}`);
238
         }
245
         }
239
 
246
 
247
+        // Android: reject very old / weak devices?
248
+        // XXX establish criteria?
249
+        /*if(Utils.isAndroid()) {
250
+        }*/
251
+
240
         // Check if WebGL2 and WebAssembly are supported
252
         // Check if WebGL2 and WebAssembly are supported
241
         return Speedy.isSupported();
253
         return Speedy.isSupported();
242
     }
254
     }

Loading…
Cancel
Save