Created
March 4, 2025 18:02
-
-
Save dzeitman/8c3f88344e79bc9604636753919e80a0 to your computer and use it in GitHub Desktop.
WebGPU alert for Safari.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isIOS() { | |
| return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; | |
| } | |
| function isSafari() { | |
| return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); | |
| } | |
| function isWebGPUSupported() { | |
| return !!navigator.gpu; | |
| } | |
| function showEnableWebGPUPopup() { | |
| const message = ` | |
| 🚀 WebGPU is not enabled in Safari on iOS. | |
| To enable WebGPU: | |
| 1. Open **Settings** on your iPhone/iPad. | |
| 2. Go to **Safari** > **Advanced** > **Experimental Features**. | |
| 3. Find **WebGPU** and toggle it ON. | |
| 4. Restart Safari and try again. | |
| After enabling WebGPU, refresh this page. | |
| `; | |
| alert(message); | |
| } | |
| window.onload = function () { | |
| if (isIOS() && isSafari() && !isWebGPUSupported()) { | |
| showEnableWebGPUPopup(); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment