upvote
Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native

(rida.dev)

I thought the demo linked to twitter was much more impressive. [1] I can't believe that was web only and not native app. Absolutely blows my mind how far we have come. I know it is prototype and there are bounds to be some edge case still not polished but I think this is the first time ever Web has native app quality, and this is without much JavaScripts.

[1]https://x.com/ridafkih/status/2122834693611819451

reply
Here's a blog post explaining that a full map navigation mode is completely on the Web. https://cartes.app/blog/navigation-mode

We've also switched a few months ago to a CSS bottom sheet, it's way better than the previous javascript version.

reply
Haven't had a chance yet to check this on iOS yet, but just to mention for those who only have access to iOS, I expected the disclaimer at the top of the page to imply that the differences between the demos would be imperceptible on Android. They aren't - the canvas is significantly worse.

I guess this may be a worthy trade-off if you're confident your userbase is 100% iOS.

reply
Did you mean the OffscreenCanvas is significantly worse? What device are you using if you don't mind me asking?
reply
On my Pixel 9, the scrollarea 'snaps' to pure vertical or horizontal scrolling when the movement is within a few degrees of those.

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.

reply
Yeah, this is a CSS property. Let me toss it on really quickly!
reply
Tested this on my Pixel 9 Pro with Firefox and Chrome.

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

reply
If you get the chance, let me know if it's fixed now. c: Unfortunately cannot reproduce it on any of my Android devices, including a Google Pixel 9, but I had a hunch.
reply
What an incredible post. Not only the bypass , but the method of hacking through WebKit source to find UX workarounds.
reply
That type of investigation has become so easy, a single prompt and a bit of waiting and your agent did all the work for you. Might have been incredible a few years ago now it’s just a nice idea.
reply
That isn’t true, though. I’ve actually paired with an LLM examining the way the browser displays things, not too dissimilar from what the OP is doing. It required a ton of handholding because there just isn’t a lot of this in its training data.
reply
Can we see your write-up about a finding like this? Why be a downer just because it’s become easier?
reply
In all honesty, any such blog post nowadays is less impressive than it would've been 5 years ago. While the OP could've stated that a bit differently, I think we all agree that it is enormously easier to do things like that with the help of AI's... Same story with beautiful websites/projects. 5 years ago, I would've devoured the source code of open source apps to learn how they pulled off some nice animation, have professional monorepo setups with various tools etc. while today - I just ask in plain english and can create the previously impossible while getting a coffee...

Not taking any shots at the article (not my niche of interest). Just stating a general observation.

reply
You also have to know, or at least suspect, it's possible. And you need to know the language to prompt with. You need to understand the problem to solve even if AI does the solution. You need to be curious enough to give it a try...

AI can do the solution and the write up, but the impetus to try still has to come from a person.

reply
My dad had a great response to the phrase "anybody could have done that"

He'd say "well they fucking didn't, did they?"

reply
Ha a wise man your dad!
reply
That glass effect is very cool but very distracting.

There's a "hide scroll tracker" toggle in the hamburger menu which hides it.

reply
I only saw a subtle difference in the first example between the scrollable square canvases, but I’m sure there are cases where it would be more noticeable. Nevertheless, this post was an interesting read.
reply
Also interesting thing is that I can use iPad’s trackpad to pan the scrollable area-based component, while the first one does nothing. Not sure if that’s related to just some disconnected JS callback, but it surprised me that it works well out of box. I use mine as a tiny laptop, and it bothers me to reach out and touch the screen on some websites that just ignore this input option.
reply
In case you’re wondering “why isn’t 120fps enabled by default”: on the native side iOS selectively enables it for transitions that cover a lot of the screen. If you use SwiftUI or UIKit it’s done for you but there are switches on CAAnimation (IIRC) that control it.

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.

reply
When scrolling past the isometric scrolling thing in firefox, it crashes the tab. But this is a very cool article and even though I'm on linux desktop, the OffscreenCanvas technique is snappier and I will be adapting it. Thanks!
reply
Just loading the page at all freezes the tab in Firefox for me.
reply
That isometric scrolling thing is nested, wtf! That's amazing.
reply
On an iPad the compositor loses track of the cursor position as you drag things. The 60 fps javascript approach keeps everything locked. It seems like there is more work to be done.
reply
Do you mind if I ask what model iPad & version of iOS you were on?
reply
By flip "Prefer Page Rendering Updates near 60fps" does the author mean turn it on, or turn it off? I'd assume on but that would suggest limiting pages to 60fps and it's the default setting in iOS 27.
reply
Interestingly the difference in smoothness is also noticeable on Android Chrome on a 120fps display.
reply
Since I own a iphone 12 and have a 60hz display, I cant apply any hack related to the screen refresh rate for now... but I liked this post and if I upgrade to a newer model in the future, I'll try.
reply
Oh, ha ha. That explains why I couldn’t see any difference.
reply
This kinda felt good.
reply
Just yesterday I watched Zed's talk on porting GPUI to the browser for Delta and they were talking about the same limitation.
reply
I wonder if Flutter apps (targeting web) can get this "for free" if the framework adopt this approach.
reply
Wow very useful for my webgame! Apple pls don't notice
reply
What kind of game are you working on?
reply
> If you’re on iOS Safari, you’ll immediately be able to tell which

I had to scroll multiple times to see the difference.

While the effort is commendable, I feel it's largely wasted.

reply
I had to concentrate incredibly hard to notice any difference, and even then, I still think there's a chance I'm imagining it
reply
Same. Only I never noticed any difference on my iPhone 15 Pro.
reply
deleted
reply
That "liquid glass" scroll tracker widget is the best ocular migraine simulator I've ever encountered. If you've ever wanted to know what an ocular migraine looks like, look a few inches away from that thing and scroll the page.
reply
Oh wow, you are right. I had to click away because I started feeling sick by association.
reply
Same, 5 seconds after scrolling and seeing that effect gave me a sense of sea-sickness and migraine (as you well said, probably just by association).
reply
Author here, I've added an option to hide it under the menu for future ocular migraine havers!
reply
I might have found it cool, if it has at least some hint of a material. There, is perfectly transparent black distortions on a black background, so very weird and very distracting, whatever purpose it serves.
reply
This is accurate. Had a migraine aura last week.
reply
> If you’re on iOS Safari

I am.

> you’ll immediately be able to tell which is which

I cannot. lol

reply
Same, looks identical to me. Tried several different motions as well but can’t pick which is which.
reply
Same as well.

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.

reply
Only iPhone 13 Pro and Pro Max models and newer support adaptive refresh rates of up to 120Hz, which are the devices this post is specifically aimed at.
reply
Not all iOS devices have 120 Hz screens.
reply
I’m on the Duo and I didn’t notice anything beyond what could be reasonably argued as a placebo effect.
reply
If you shake your hand in front of a strobe light, you should be able to count the afterimages, as if your hand was copied into multiple places in the same instant.

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.

reply
If it takes that much effort then what’s the actual benefit of this vs the trade offs (battery life, more complicated code base and all the edge case rendering glitches)?
reply
My test was to rapidly wiggle the boxes up and down and I could see 4 shadows on one and 8 on the other. Definitely a difference.
reply
Likewise. Maybe it’s my old-man (47) eyes, but I saw no difference!
reply
They were night and day. iPhone 17 Pro, iOS 27 (not in low power mode)
reply
It’s fun that Fable completely fails on this. OffscreenCanvas is _designed_ to bypass paint and go straight to the compositor and it’s not a new feature. It’s one of the really great things about OffscreenCanvas. Primarily it’s to allow a worker to update the canvas without worrying about the main context being blocked by user interaction, layout, paint, etc.

I couldn’t have told you if this would have triggered the compositor at 120Hz but if anything worked it would be this.

reply
To me it sounds like discussing the purity of audio sound quality when using gold coated audio cables for those speakers that cost as much as a house, connected to a top end turn tablet.

Interesting from technical point of view, could not care less for all practical purposes.

reply
The difference between 60 and 120fps is nothing like the placebo level, completely non-existent differences between many expensive audio cables.
reply
So far it seems a waste of money to buy 120fps capable devices.
reply
To each their own. It's probably the biggest upgrade in overall computer and device experience in the last decades in my opinion, along with SSDs.
reply
My phone battery is crying just looking at this.
reply
deleted
reply
this is what we need
reply
> If you’re on iOS Safari, you’ll immediately be able to tell which is which because one refreshes at most 60 times a second in a renderer pass, while the other uses the compositor.

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

reply
Curious, can you tell the difference if you turn on Low Power Mode? The one on the left will drop to 30 Hz while the one on the rate will pin to the device refresh rate of 60 Hz. I am starting to think some people genuinely can't tell the difference between 60 Hz and 120 Hz.
reply
Too many years playing vidya so I can tell. Also notice weird frame rates on OLED TV sometimes.

Midrange Android phones have had 120hz screens for years! Although I'll be the first to admit that specs aren't everything.

reply
I honestly can't. I can barely tell the difference between 30Hz and 60Hz if the action isn't high speed.
reply
> I am starting to think some people genuinely can't tell the difference between 60 Hz and 120 Hz.

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.

https://en.wikipedia.org/wiki/Soap_opera_effect

reply
Agreed, if I leave my finger on the screen there is absolutely no difference.

If I lift my finger then I see the inertia, but that's the only difference.

reply
Yeah same, they both act exactly the same, except one you can fling out of bounds. I’d never know there was supposed to be some sort of magical ‘native feel’ to one of them.

iPhone SE 2nd gen, ios 27.2.1

reply
Your iPhone, like mine, has a 60Hz screen, so it physically can’t show the supposed difference.
reply
deleted
reply
Is this the same on other browsers or just a WebKit thing? Apple is know for deliberately holding back web technologies in their browser to make their apps look better in comparison, this might just be another example.
reply
Safari is one of the greatest pieces of niche applications. It has to be made exactly good enough for web browsing that users don’t feel like downloading an alternative but also exactly bad enough for building web apps on it so that developers are forced to create a native iOS app.
reply
There are no alternatives on iOS. Apple doesn't allow it.

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.

reply
> It has to be made exactly good enough for web browsing that users don’t feel like downloading an alternative

Is there really any alternatives? I use FF on iOS, but its still wrapped in Webkit, not Gecko.

reply
Why there are still no non-WebKit browsers on iOS | 599 points | 5 days ago| 336 comments | https://news.ycombinator.com/item?id=50575644

https://blog.mozilla.org/en/mozilla/internet-policy/apple-io...

reply
"Forced".

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.

reply
I have nothing to add on IOS or a 60fps website cap… but I did notice the “glass” UI element in the top left corner and how much more glass looking that is than whatever Apple tried to do. The chromatic aberrations are a nice touch.
reply
Liquid Glass also has chromatic aberration. That sample on the website is actually pretty much exactly what certain configurations of Liquid Glass looks like.
reply
deleted
reply
[flagged]
reply
Please keep liquid glass out of websites… It is very distracting and useless.
reply
I guess in this post it served a purpose, it was the example of how a full site could react in 120 Hz to inputs.

But man, is that effect how annoying it is to use iOS now?

reply
I noticed that glass thing in the top right immediately on my iPhone.

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".

[1] https://i.imgur.com/6cRn9Gs.jpeg

reply
Agreed. This feels like one of the few times apple have listened to customer feedback.

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!)

reply
It's probably as close as we can get to Apple admitting they were wrong.
reply
You're the first person who has made that criticism that actually understood why glass was used for the demo page.

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.

reply
I don’t think so. The upper left icon was unusually distracting (iOS 27).
reply
The white square glitches out on latest iOS iPhone Duo.

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.

reply
Still waiting for a Rust framework which can replace Flutter for Android and iOS development
reply
I don't know about Rust framework, but Kotlin Multiplatform has always been a good option compared to Flutter. It has good interop so you can build actual native iOS UI while sharing business logic in Kotlin, or you can just build the UI in Compose Multiplatform (decently fast on iOS, literally native on Android which is the more important platform because Androids are slower).
reply
The unfortunate thing is that measuring framerate is another vector that lets you de-anonymize people, and shitty companies that operate what's left of the www all use advanced methods of de-anonymization so they can advertise or sell that shit to palantir. And governments are planning to make it illegal to have a website that isn't a spying apparatus. That's where we're at. The web is not going to be "free as in freedom" for much longer if we let trends continue. Stallman was right, outside of eating toenails or whatever.
reply
"Apple" should instead be named "Asshole", this describes their approach to web apps well..
reply
60fps is perfectly serviceable. That first example is updating _at most_ 60fps and that phrase is doing a lot of heavy lifting. What you see is <60fps jerks. This article feels disingenuous
reply
Sure, dropping frames is worse, but why would it ever be acceptable for an app to cap itself at half the screen's refresh rate? Especially when the difference between 60 and 120fps is very noticeable?
reply
Some monitors/OSes default to 60Hz even if the monitor is capable of higher. I've seen posts by people who claimed to have run their fast monitor at 60Hz by accident because they didn't know this.

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.

reply
> Especially when the difference between 60 and 120fps is very noticeable?

It's not really noticeable in my opinion. Hell, even 30 to 60 FPS isn't noticeable.

reply
There are two different kinds of people...
reply
Oh it is. Going from 60 to 120 is a big difference. Even from 120 to 180 or 240 is a big difference. Everyone will notice it. Does it affect your productivity? Probably not.
reply
60 to 120 is a big difference. 120 to 240 is nice to have but not as dramatic. Considering how unpleasant it is to do anything on a mobile device because of how much worse a touchscreen is than keyboard and mouse, I think it's reasonable to cap at 120fps or even 60fps if it saves battery. By using a mobile device you're already accepting an inferior user experience.
reply
are you just pretending or...? you can immediately notice when you scroll up and down
reply
As I understand it, a pretty significant percentage of people can't really see the difference between 60 and 120hz. I personally only notice it in a few edge cases
reply
I mean, 30 and hz, not noticing that is pretty surprising

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

reply
By "first example," do you mean the glass element on the top-left, or do you mean the first pair of grids?

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.

reply
Not sure why you are getting downvoted. The problem is NOT that it's capped to 60fps, it's the yanks and jerks. Which I guess could be a web platform or Safari issue, but 60fps in itself is smooth on native apps.
reply