NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native (rida.dev)
ksec 2 hours ago [-]
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

smcleod 11 minutes ago [-]
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.
andai 4 hours ago [-]
That glass effect is very cool but very distracting.

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

srcreigh 7 hours ago [-]
What an incredible post. Not only the bypass , but the method of hacking through WebKit source to find UX workarounds.
throwaway63467 4 hours ago [-]
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.
samuria 3 hours ago [-]
Can we see your write-up about a finding like this? Why be a downer just because it’s become easier?
Bishonen88 3 hours ago [-]
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.

onion2k 3 hours ago [-]
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.

walthamstow 3 hours ago [-]
My dad had a great response to the phrase "anybody could have done that"

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

guardiandemon 1 hours ago [-]
Ha a wise man your dad!
bruce343434 20 minutes ago [-]
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!
petrichorko 3 hours ago [-]
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.
marmarama 13 minutes ago [-]
Interestingly the difference in smoothness is also noticeable on Android Chrome on a 120fps display.
lucideer 1 hours ago [-]
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.

ridafkih 37 minutes ago [-]
Did you mean the OffscreenCanvas is significantly worse? What device are you using if you don't mind me asking?
jeroenhd 8 minutes ago [-]
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.

andai 4 hours ago [-]
That isometric scrolling thing is nested, wtf! That's amazing.
doug_durham 7 hours ago [-]
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.
ridafkih 6 hours ago [-]
Do you mind if I ask what model iPad & version of iOS you were on?
giorgiogamba 11 minutes ago [-]
this is what we need
normcu 4 hours ago [-]
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.
ghrl 2 hours ago [-]
Just yesterday I watched Zed's talk on porting GPUI to the browser for Delta and they were talking about the same limitation.
wiradikusuma 2 hours ago [-]
I wonder if Flutter apps (targeting web) can get this "for free" if the framework adopt this approach.
iniekaas 8 hours ago [-]
This kinda felt good.
2001zhaozhao 6 hours ago [-]
Wow very useful for my webgame! Apple pls don't notice
andai 4 hours ago [-]
What kind of game are you working on?
troupo 4 hours ago [-]
> 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.

46 minutes ago [-]
trumbitta2 2 hours ago [-]
Same. Only I never noticed any difference on my iPhone 15 Pro.
CGamesPlay 8 hours ago [-]
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.
jakespencer 8 hours ago [-]
Oh wow, you are right. I had to click away because I started feeling sick by association.
trymas 5 hours ago [-]
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).
ridafkih 6 hours ago [-]
Author here, I've added an option to hide it under the menu for future ocular migraine havers!
ale42 4 hours ago [-]
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.
JohnTHaller 8 hours ago [-]
This is accurate. Had a migraine aura last week.
shortercode 2 hours ago [-]
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.

jkahrs595 8 hours ago [-]
> If you’re on iOS Safari

I am.

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

I cannot. lol

sitharus 7 hours ago [-]
Same, looks identical to me. Tried several different motions as well but can’t pick which is which.
ckaik 6 hours ago [-]
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.

kalev 5 hours ago [-]
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.
MBCook 7 hours ago [-]
Not all iOS devices have 120 Hz screens.
hnlmorg 4 hours ago [-]
I’m on the Duo and I didn’t notice anything beyond what could be reasonably argued as a placebo effect.
ridafkih 4 hours ago [-]
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.

convivialdingo 7 hours ago [-]
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.
Nursie 8 hours ago [-]
Likewise. Maybe it’s my old-man (47) eyes, but I saw no difference!
Barbing 5 hours ago [-]
They were night and day. iPhone 17 Pro, iOS 27 (not in low power mode)
pjmlp 3 hours ago [-]
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.

ubercow13 21 minutes ago [-]
The difference between 60 and 120fps is nothing like the placebo level, completely non-existent differences between many expensive audio cables.
__alexs 2 hours ago [-]
My phone battery is crying just looking at this.
wodenokoto 3 hours ago [-]
> 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

ridafkih 3 hours ago [-]
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.
guardiandemon 58 minutes ago [-]
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.

true_religion 3 hours ago [-]
I honestly can't. I can barely tell the difference between 30Hz and 60Hz if the action isn't high speed.
latexr 3 hours ago [-]
> 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

j_leboulanger 3 hours ago [-]
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.

mock-possum 3 hours ago [-]
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

latexr 3 hours ago [-]
Your iPhone, like mine, has a 60Hz screen, so it physically can’t show the supposed difference.
2 hours ago [-]
throwaway63467 4 hours ago [-]
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.
Rodmine 5 hours ago [-]
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.
Alifatisk 4 hours ago [-]
> 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.

hurfdurf 4 hours ago [-]
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...

rimliu 4 hours ago [-]
"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.

SV_BubbleTime 8 hours ago [-]
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.
marcellus23 8 hours ago [-]
Liquid Glass also has chromatic aberration. That sample on the website is actually pretty much exactly what certain configurations of Liquid Glass looks like.
6 hours ago [-]
nanapipirara 6 hours ago [-]
Please keep liquid glass out of websites… It is very distracting and useless.
matsemann 5 hours ago [-]
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?

leokennis 5 hours ago [-]
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

hnlmorg 4 hours ago [-]
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!)

steve1977 4 hours ago [-]
It's probably as close as we can get to Apple admitting they were wrong.
ridafkih 5 hours ago [-]
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.

Barbing 5 hours ago [-]
I don’t think so. The upper left icon was unusually distracting (iOS 27).
hnlmorg 4 hours ago [-]
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.

faangguyindia 7 hours ago [-]
Still waiting for a Rust framework which can replace Flutter for Android and iOS development
2001zhaozhao 6 hours ago [-]
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).
zote 5 hours ago [-]
smolder 6 hours ago [-]
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.
zb3 7 hours ago [-]
"Apple" should instead be named "Asshole", this describes their approach to web apps well..
catlifeonmars 8 hours ago [-]
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
Rohansi 7 hours ago [-]
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?
bigstrat2003 7 hours ago [-]
> 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.

arcanemachiner 6 hours ago [-]
There are two different kinds of people...
holoduke 5 hours ago [-]
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.
r_lee 5 hours ago [-]
are you just pretending or...? you can immediately notice when you scroll up and down
swiftcoder 5 hours ago [-]
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
r_lee 4 hours ago [-]
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

ridafkih 5 hours ago [-]
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.

sgt 5 hours ago [-]
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.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 12:21:57 GMT+0000 (Coordinated Universal Time) with Vercel.