Skip to content

gh-128627: Fix iPad detection in wasm-gc #135388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Python/emscripten_trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ EM_JS(CountArgsFunc, _PyEM_GetCountArgsPtr, (), {
// )

function getPyEMCountArgsPtr() {
let isIOS = globalThis.navigator && /iPad|iPhone|iPod/.test(navigator.platform);
// Starting with iOS 18.3.1, WebKit on iOS has an issue with the garbage
// collector that breaks the call trampoline. See #130418 and
// https://bugs.webkit.org/show_bug.cgi?id=293113 for details.
let isIOS = globalThis.navigator && (
/iPad|iPhone|iPod/.test(navigator.userAgent) ||
// Starting with iPadOS 13, iPads might send a platform string that looks like a desktop Mac.
// To differentiate, we check if the platform is 'MacIntel' (common for Macs and newer iPads)
// AND if the device has multi-touch capabilities (navigator.maxTouchPoints > 1)
(navigator.platform === 'MacIntel' && typeof navigator.maxTouchPoints !== 'undefined' && navigator.maxTouchPoints > 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated same-comment here: pyodide/pyodide#5695 (review)

)
if (isIOS) {
return 0;
}
Expand Down
Loading