hckrnws
Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native
by vinhnx
by vinhnx
We've also switched a few months ago to a CSS bottom sheet, it's way better than the previous javascript version.
[dead]
The web has no equivalent. So it’s all 120hz all the time, or not. And that would drain the battery more than Apple would like.
There's a "hide scroll tracker" toggle in the hamburger menu which hides it.
I guess this may be a worthy trade-off if you're confident your userbase is 100% iOS.
I notice no difference, what should happen?
I had to scroll multiple times to see the difference.
While the effort is commendable, I feel it's largely wasted.
Direct Manipulation API which supports “absolute” transformations that are independent of line / row size, as well as asynchronous rendering (Windows8 API for touch-based scrolling) .. it’s possible to register a window as a Direct Manipulation consumer and receive the pixel-precise input events without involving the rendering parts of the API (however, that requires both compatible hardware and proper application support) like:
first, the driver tries to use Direct Manipulation API for “pixel-perfect” scrolling,
* then, if application doesn’t support the API (very few do), the driver tries to find and manipulate application scrollbar(s) directly (by sending WM_HSCROLL and WM_VSCROLL messages, like with legacy touchscreen panning), because, unlike the mouse wheel events, scrollbars can support pixel-precise deltas (this step might not work for widget toolkits that don’t use native scrollbars), *
finally, if there are neither the Direct Manipulation API, nor a suitable scrollbar available, the driver resorts to sending the high-resolution WM_MOUSEWHEEL messages.
Windows supports pixel-precise scrolling only in the combination of Precision Touchpad driver and Direct Manipulation API (yet Direct Manipulation is too all-encompassing and is never meant to used just for input).
- from: https://pavelfatin.com/scrolling-with-pleasure/No. The difference has nothing to do with refresh rate. They move differently using different logic. I can only tell them apart because one has inertia and keeps moving after release. If I keep my thumb down they are the same.
IPhone 17, iOS 26
I am.
> you’ll immediately be able to tell which is which
I cannot. lol
Is there really any alternatives? I use FF on iOS, but its still wrapped in Webkit, not Gecko.
I couldn’t have told you if this would have triggered the compositor at 120Hz but if anything worked it would be this.
Not that I'm an Apple junkie, but this is like learning Ford caps its trucks at 100HP if you swap rims, or something.
If I bought an iPhone with high refresh rate, took it home and realized my browser (the main app I use on a phone) is locked at half the device's capacity, I would immediately get a refund.
Interesting from technical point of view, could not care less for all practical purposes.
(https://lobste.rs/s/pxvmxo/bypassing_ios_safari_60_fps_limit...)
[deleted]
But man, is that effect how annoying it is to use iOS now?
[dead]
[dead]
[dead]
[dead]
[dead]
But my advice here is just don’t do it. Respect your users battery life. If you want a native feel then compile to native code.
Not taking any shots at the article (not my niche of interest). Just stating a general observation.
I agree with the above post: this is routine Claude behavior. If you ask it a question about implementation details, it'll acquire and read the source. If it can't do that, _it will disassemble the code_. I was surprised two months ago; now I'm used to it.
AI can do the solution and the write up, but the impetus to try still has to come from a person.
[deleted]
He'd say "well they fucking didn't, did they?"
That would be desirable in the normal use case of scrolling through content, but in this application causes the item dragging to be erratic and not follow my finger reliably.
The "improved" canvas seems to lose tracking with my finger. It's perfectly smooth (although both seem to be?), but at the end of a little wiggle motion, the square is no lunger underneath my finger.
This also makes the glass-pill-drag control look weird, because I expect the pill to be dragged along further than it actually ends up being.
The effect is much more pronounced on Firefox, but scrolling feels weird and off in Chrome as well. I also don't even know if you need this hack to work around the frame rate issue on Android.
I recorded my screen with the touch tracing feature enabled: https://bijlage.zip/e218ea6b-389f-4ac0-9e3c-c1f45624e05f.mp4
Earlier or lower tiers models only has a 60hz display and if you’re not seeing a difference, it’s because on your device there probably isn’t.
A iPhone 12 only has a 60hz display - so nothing in this article matters on your device.
I have hard time noticing any difference in the examples on iPhone 16 Pro
[deleted]
That’s certain. Lots of people also can’t perceive the soap opera effect, even if you turn off frame interpolation on their TV and show them the before and after.
It's why the screen is 120Hz not 240Hz or 1200Hz after all, somewhere in the 60-120Hz range is "enough" and for a lot of people 120 is already only a minor benefit at best over 60
Midrange Android phones have had 120hz screens for years! Although I'll be the first to admit that specs aren't everything.
iPhone SE 2nd gen, ios 27.2.1
[deleted]
If I lift my finger then I see the inertia, but that's the only difference.
I’d suggest that this particular object respect the prefers-reduced-motion setting if it doesn’t already.
I'm on an iPhone with ProMotion and both of these are running at 120 fps here. I thought I was going mad, so I had to dig into it a little, even if it's just to provide op with more information.
As far as I could tell (Settings.app's Search seems useless) there are three settings you could engage to influence the refresh rate of websites in Safari:
- Low Power Mode
- "Prefer Rendering Updates at 60Hz" Feature Flag in Safari - which is enabled by default
- Limit Refresh Rate in Accessibility -> Motion
I didn't try Low Power Mode, but the Accessibility setting did the trick for me and I was immediately able to see the difference.
Not sure what's causing this. I'm on an iPhone 15 Pro Max running iOS 27.0.1.
Same goes here. If you go to the first two grids, and you shake the square until you can count the afterimages, check to see if one shows more afterimages than the other despite the same speed.
If your device is genuinely limited to 60Hz for any reason or another, you'll see a little warning icon on the top-right.
It might be easier in Low Power Mode, as well. This'll reduce the requestAnimationFrame loop to 30 Hz, but the higher refresh rate examples in this post will show at 60 Hz.
i have a 15 pro max and a new ipad, no low power mode, frame rate is not limited in accessibility settings...
it's extremely subtle if percievable at all.
https://blog.mozilla.org/en/mozilla/internet-policy/apple-io...
But yes, Safari seems to be made just bad enough that people are forced to make apps even for things that don't benefit from being apps.
As someone proficient with both ways of building things: if you do know native development (and I mean "know", not "dabbled for a couple of hours") you'd need really to force me to do apps the other way.
[deleted]
Especially because since iOS27, there is a slider to put Liquid Glass into a less transparent look [1] so the glass pill on this site stood out immediately as "the bad old iOS26 days" of Liquid Glass.
With the newly possible iOS27 look, I'd say it is a perfect blend of "looks nice" and "still readable".
But then it was also such a massive own goal in terms of design it would have been ridiculous not to (even more ridiculous than the fact they ever released their platforms that way to begin with!)
Every "liquid glass on web" library in existence falls short because it can't keep up the compositor refresh rate. Simple as that. Part of it was also bringing native UI to the web because I figured it'd be quite jarring to see a convincingly native element in a website for those familiar with web development.
As for using iOS, Apple doesn't use the glass effect (`_UILiquidLensView`) I used for the progress/scroll indicator outside of a very select few use-cases because (as is the case on this website) if it's not positioned squarely in the centre of your macula, the intensity of the refraction combined with the chromatic aberration makes it so that it appears flashy and distracting. I accepted it for the sake of the demo.
And a fast monitor needs a fast mouse to take full advantage of it. USB mouse protocol does not inform the mouse of the monitor's refresh phase/frequency, so the mouse has to run asynchronously. You need a high mouse sampling rate to avoid noticeable beat patterns caused by this discrepancy. Non-gaming mice sometimes only support 125Hz, which isn't even enough for 60Hz monitors. Common gaming mice support 1000Hz, which is enough for perceptibly flawless mouse control at 120Hz, but for 240Hz you need a high-end gaming mouse with higher sampling rate.
This is far more understandable because that makes everything run at 60Hz. The article here is a scenario where you have 60Hz content mixed in with 120Hz on the same screen. But still, people who are accustomed to high refresh rate displays would be able to immediately notice.
> And a fast monitor needs a fast mouse to take full advantage of it.
Ideally, yes, but you don't need a high polling rate mouse to be able to notice the difference.
It's not really noticeable in my opinion. Hell, even 30 to 60 FPS isn't noticeable.
Low to mid tier devices might get hitches on the glass elements since the glass runs on the GPU during scrolls. If you mean the actual first demo and the one on the right is rendering below 120 Hz, your device is simply not capable of it.
I've been making websites for over a decade now, and yet even with AI in the loop, the blog post and demos took almost 5 days to become publishable, and another 4 to get the performance in a place where I was happy. This is because of the hybrid approach, and needing to build the entire page around that fact.
Would I ever use liquid glass in an actual website? I would not, and certainly not as I did here with an annoying `_UILiquidLensView`-inspired scroll indicator. Do I think it serves as a good illustration/example for high-refresh rate websites on mobile? Absolutely!
the question I have is this: if the difference between 60hz and 120hz matters, then why wouldn’t you choose a different software stack that compiles down to native code? You end up with better performance, better battery life, and cleaner code.
I get this page should be treated as a lab demonstrating a solution. But it is, in my humble opinion, the wrong solution to that problem presented because it comes with far too many negative trade offs.
And the AI point you raise is a great one. Because the old argument of sticking firmly with the web stack (“I only know how to use JavaScript so therefore I’m going to shoehorn JavaScript into every problem”) no longer applies.
As for whether refresh rate matters, the community seems to think so. The WebKit bug forum alone is filled with framework authors, drawing applications, game engine developers, etc., all begging Apple to drop the cap.
That drawing application? It could use the controllers on their canvas and immediately double the resolution of their brush stroke interpolation. PWAs never had the ability to render above 60 FPS, even if the user opted out of the limit, now they can. These two things can be easily implemented with minimally invasive code. This demo is just a hybrid on the extreme end.
Even if you throw away the I/O frequency, even if a developer were to now ask "hey, should this be on the compositor instead?" is a massive win for performance and battery life.
People have already begun to take small learnings from this and apply them to their projects, my favourite is this user's portfolio (https://github.com/decepulis/portfolio-svelte-site/pull/12) where they were able to figure out why, on scroll direction change, their rAF was slowing to 10 Hz, and citing this post as the source for the fix.
For some reason, people continue to build for the web. Whether it's an attempt to opt out of the underside of Apple's thumb, a preference for web frameworks, wanting cross-platform or ease-of-access, not wanting to go through App Store Connect, etc., this puts more tools in their tool belt. It's not meant to be an alternative for people considering building a native application.
There is a reason I chose not to make this a library, or a framework. This is meant to be something people can throw their agents at, and fix the problems they encounter.
and 60 vs 120hz, you may not notice it immediately but when you e.g. move a window around on a monitor you should be able to feel it, at least for me it's instantly noticeable, but you may not notice it if you're not switching between or aren't moving things around