Why a site breaks only on iPhone Safari, and how to fix it
The usual reasons a site works in Chrome but fails on an iPhone: date parsing, 100vh, video autoplay, cookies, pop-ups, zooming forms and more, each with the fix.
It works on your laptop. It works in Chrome on Android. Then someone sends a screenshot from their iPhone and the page is blank, the button does nothing, or the layout is cut off. This is one of the most common bugs on the web, and it has a short list of usual causes.
Every browser on an iPhone is Safari underneath
On iPhone, Chrome, Firefox and Edge all use Apple's WebKit engine, the same one as Safari. (Since iOS 17.4 in the EU, and since iOS 26.2 in Japan, browsers Apple has authorized may use their own engine, but most still use WebKit.) So "it breaks in Chrome on my iPhone" is almost always a Safari bug, and testing desktop Chrome tells you little about it.
Desktop Safari on a Mac is close, but not the same: it has no on-screen keyboard, no address bar that shrinks as you scroll, different touch handling and different memory limits. The only reliable test is a real iPhone.
Dates that parse in Chrome and not in Safari
new Date("2026-11-23 10:00") works in Chrome, but it isn't portable. The JavaScript standard's date-time format puts a T between the date and the time; with a space instead, the string is outside that format, so how it parses is up to each browser, and Safari has returned Invalid Date for strings like it.
Fix: for a moment in time, send and parse the standard date-time form with an explicit offset (2026-11-23T10:00:00Z or 2026-11-23T10:00:00+01:00), or build dates from numbers: new Date(2026, 10, 23, 10, 0). A date library that parses the formats you accept is fine too. Never hand a free-form string to new Date().
100vh is taller than the screen
On iPhone, 100vh is the height with the address bar hidden. When the page first loads the bar is showing, so anything sized 100vh runs off the bottom of the screen: a full-screen menu whose last item can't be reached, or a button hidden under the toolbar.
Fix: use the newer units. 100svh is the height with the bars showing, 100lvh with them hidden, and 100dvh follows them as they change. They're supported in Safari 15.4 and later. Keep 100vh before them as a fallback for older browsers.
Video that won't play on its own
Safari plays a video automatically only when it's muted or has no audio track, and on iPhone it goes full screen unless it's allowed to play inline. Apple's rules are in WebKit's video policy.
Fix: a background or hero video needs autoplay muted playsinline (and loop if it repeats). muted is what lets it start whatever its file holds, so keep it even on a video you made without sound. Anything with sound starts from a tap.
Forms that zoom in when you tap them
When a text field's font is smaller than 16 pixels, Safari on iPhone zooms the page in when it's tapped, and doesn't zoom back out. The layout looks broken from then on.
Fix: give inputs, selects and text areas a font size of at least 16 pixels on small screens. Don't turn off zooming for the whole page to hide it: people need zoom to read.
Pop-ups that never open
Safari opens a window from window.open() only while the tap's transient user activation lasts, and blocks it without an error after that. If your code waits for something first (await fetch(...) and then window.open(...)), a slow wait can outlast it. How long it lasts differs between browsers, so a pop-up that opens in Chrome can be blocked in Safari.
Fix: open the window in the tap handler itself, then set its address when your data arrives, or use a normal link.
Cookies from another site are blocked
Safari blocks third-party cookies by default. A sign-in inside an iframe, a payment widget or an embedded tool that relies on its own cookies can fail only in Safari, often as a sign-in loop.
Fix: keep sign-in on your own domain (a subdomain counts) or in a top-level window. Embedded tools that need their own cookies should use the Storage Access API.
A feature Safari doesn't have yet
Each Safari version supports a different set of web features, and people keep older iPhones for years. A new CSS feature or JavaScript method that works everywhere else can throw an error on an iPhone two versions behind, and one error can stop the rest of a page's script.
Fix: check the feature on Can I use against the Safari versions your visitors have, and set your build's browser targets to match. Wrap optional features in a check (if ("x" in window), @supports) so the rest of the page still works.
Pages restored from the back button
Safari often restores the previous page exactly as it was when someone taps Back, without reloading it. A page that set a loading spinner before leaving shows the spinner for ever, and data can be out of date.
Fix: listen for pageshow and check event.persisted. When it's true, reset anything that should be fresh.
Hover menus on a touch screen
There's no hover on a phone. A menu that only opens on :hover either never opens or opens and won't close.
Fix: open menus on tap, and keep hover styles behind @media (hover: hover).
How to find the cause on your own iPhone
- On the iPhone: Settings, Apps, Safari, Advanced, and turn on Web Inspector.
- Plug it into a Mac, open Safari on the Mac, turn on the Develop menu (Safari Settings, Advanced) and pick your iPhone from it.
- The console shows the exact error, and the Network tab shows what failed to load.
This works for one phone and one page at a time. To catch these before your users do, test every change on a real iPhone automatically.
An iPhone or iPad on iOS 12 or earlier can't be tested by PocketQA: see how old a phone can be and still be tested.