ANLGBOY commited on
Commit
8665f9e
·
1 Parent(s): de6295c
Files changed (1) hide show
  1. script.js +7 -2
script.js CHANGED
@@ -1295,11 +1295,16 @@ document.addEventListener('DOMContentLoaded', () => {
1295
  // Detect iOS/Safari
1296
  const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
1297
  (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
 
1298
 
1299
  // iOS and Safari have incomplete WebGPU support
1300
  if (isIOS) {
1301
  return { supported: false, reason: 'iOS does not support the required WebGPU features' };
1302
  }
 
 
 
 
1303
 
1304
  // Check if WebGPU is available in the browser
1305
  if (!navigator.gpu) {
@@ -1446,8 +1451,8 @@ document.addEventListener('DOMContentLoaded', () => {
1446
  // If WebGPU is not supported, show message and disable demo
1447
  if (!webgpuCheck.supported) {
1448
  // Show specific message for iOS users
1449
- const errorMessage = webgpuCheck.reason.includes('iOS')
1450
- ? `<strong>iOS is not currently supported.</strong><br>Please use a desktop browser that supports WebGPU (Chrome 113+, Edge 113+).`
1451
  : `Please use a browser that supports WebGPU (Chrome 113+, Edge 113+, or other WebGPU-enabled browsers).`;
1452
 
1453
  showDemoStatus(errorMessage, 'error', 100);
 
1295
  // Detect iOS/Safari
1296
  const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
1297
  (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
1298
+ const isSafari = /^((?!chrome|crios|android|edg|firefox).)*safari/i.test(navigator.userAgent);
1299
 
1300
  // iOS and Safari have incomplete WebGPU support
1301
  if (isIOS) {
1302
  return { supported: false, reason: 'iOS does not support the required WebGPU features' };
1303
  }
1304
+ if (isSafari) {
1305
+ // Desktop Safari might work, but check carefully
1306
+ return { supported: false, reason: 'Safari does not support the required WebGPU features' };
1307
+ }
1308
 
1309
  // Check if WebGPU is available in the browser
1310
  if (!navigator.gpu) {
 
1451
  // If WebGPU is not supported, show message and disable demo
1452
  if (!webgpuCheck.supported) {
1453
  // Show specific message for iOS users
1454
+ const errorMessage = webgpuCheck.reason.includes('iOS') || webgpuCheck.reason.includes('Safari')
1455
+ ? `<strong>iOS/Safari is not currently supported.</strong><br>Please use a desktop browser that supports WebGPU (Chrome 113+, Edge 113+).`
1456
  : `Please use a browser that supports WebGPU (Chrome 113+, Edge 113+, or other WebGPU-enabled browsers).`;
1457
 
1458
  showDemoStatus(errorMessage, 'error', 100);