Skip to content

Commit 010d073

Browse files
committed
iOSではworker実行環境読み込み時にalertを出す
1 parent 9b048dc commit 010d073

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/runtime/src/worker/runtime.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ export function WorkerProvider({
129129
await initializeWorker();
130130
setReady(true);
131131
});
132+
if (isIOS()) {
133+
alert(
134+
"iPhone/iPadでは実行環境が正しく動作しない場合があります。PCで利用してください。"
135+
);
136+
}
132137
return () => {
133138
void mutex.runExclusive(async () => {
134139
// Reject all pending promises
@@ -306,3 +311,13 @@ export function WorkerProvider({
306311
</context.Provider>
307312
);
308313
}
314+
315+
function isIOS(): boolean {
316+
// Source - https://stackoverflow.com/a/58065241
317+
// Posted by kikiwora, modified by community. See post 'Timeline' for change history
318+
// Retrieved 2026-03-19, License - CC BY-SA 4.0
319+
return (
320+
/iPad|iPhone|iPod/.test(navigator.platform) ||
321+
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)
322+
);
323+
}

0 commit comments

Comments
 (0)