How to Get 120 FPS in iOS Safari Without a Settings Flag

You can get 120 FPS in iOS Safari without asking users to flip a setting. Read touch input from a scroller the compositor moves, poll its position in step with the screen, and draw through an OffscreenCanvas. Each step has a cost in battery or CPU, so you turn it on only during a gesture.

In Bypassing iOS Safari’s 60 FPS Limit to Build Web Applications That Feel Native, Rida F’kih walks through how they got there. Below are the result, the four steps with their numbers, and where the approach falls short.

Table of Contents

The result: 60 to 120

On a 120 Hz iPhone, WebKit limits requestAnimationFrame to 60 Hz unless the user turns off “Prefer Page Rendering Updates near 60fps” in Safari’s developer settings, F’kih writes. Touch and pointer events on a normal page get the same 60 Hz limit. That’s why even well-built mobile sites feel a step behind your finger.

F’kih’s end state is 120 Hz input and 120 FPS canvas rendering, with no flag. The plain DOM still updates at 60. CSS animations and scroll-driven effects carry the rest.

Step 1: read input from a scroller

Scrolling belongs to the compositor, which runs on its own thread and needs no JavaScript round-trip. So F’kih lays an invisible scrollable area over the element and treats its position like a trackpad. Momentum, rubber banding and snap points come for free from the browser.

One catch: scrollTop and scrollLeft round to whole points. The fix in the article is to scale the scrollable surface up by the device pixel ratio and its container back down.

Step 2: poll the scroll position in step with vsync

Scroll events are too slow for this. F’kih measured 5 to 26 updates a second during momentum scrolling. The first fix, a MessageChannel that calls itself, read 50,000 times a second but saw only 80 distinct values, and it pinned a CPU core. Atomics also reached 80, but it needs SharedArrayBuffer, and the COOP/COEP headers that requires broke cross-origin assets.

What worked: a MessageChannel throttled with setTimeout to the screen’s refresh interval and phase-locked to vsync with requestAnimationFrame timestamps. That gave 80 reads a second without the wasted work.

Step 3: push the screen to 120 Hz

Safari sends one scroll position at a time and waits for an acknowledgement, overwriting anything in between. It flushes without waiting on ticks where the page has a rendering update queued, so an empty requestAnimationFrame loop raised the count to 90 a second.

The last 30 came from ProMotion. A tiny invisible element that smooth-scrolls in the background keeps the display at 120 Hz. F’kih turns these tricks on only around touches and animations, so the screen isn’t held at 120 Hz the whole time.

Step 4: draw through OffscreenCanvas

Faster input means little if the page still paints at 60. F’kih tried seven approaches here. The one that held is canvas.transferControlToOffscreen():

// The <canvas> becomes a placeholder; frames pushed from the OffscreenCanvas
// skip WebKit's wait for the next rendering update.
const offscreen = document.querySelector("canvas").transferControlToOffscreen();

Following the HTML spec, WebKit doesn’t wait for the next rendering pass when an OffscreenCanvas pushes a frame. F’kih reports it’s easy on the battery and uses only the memory a faster backing store needs.

Where it falls short

Apple caps the web on purpose, one developer in the discussion explained. Native iOS turns on 120 Hz selectively for transitions that cover a lot of the screen. The web has no such switch, so it would be 120 Hz all the time, and that drains the battery. Step 3 is the manual version of that switch, and it’s yours to get wrong.

The results also vary by device. One developer found the canvas demo noticeably worse on Android. Another reported that on an iPad the compositor version lost track of the cursor while dragging, while the 60 FPS JavaScript version stayed locked. On a 60 Hz iPhone none of it shows.

What to do this week

  • Profile your slowest touch interaction on a 120 Hz iPhone with the flag on and off, so you know what the gap costs you.
  • If it’s a drag, try step 1 alone: an invisible scroller with a passive listener. F’kih notes that a passive touchmove listener on the controller fires at the full 120 Hz when you don’t need momentum.
  • Reach for steps 2 to 4 only for canvas or WebGL work, and test on Android and iPad before shipping.

FAQ

Why is iOS Safari limited to 60 FPS?

WebKit limits requestAnimationFrame, and with it touch and pointer events, to 60 Hz unless the user changes a developer setting. One developer in the discussion pointed to battery: native apps turn on 120 Hz only for large transitions, and the web has no equivalent switch.

Can a web page force 120 Hz on an iPhone?

Not through a public setting. F’kih’s approach reaches 120 Hz input with compositor-driven scrollers and 120 FPS rendering with OffscreenCanvas. The display goes to 120 Hz only while something is scrolling.

Does OffscreenCanvas render faster in Safari?

In F’kih’s tests, yes. When an OffscreenCanvas from transferControlToOffscreen() pushes a frame, WebKit doesn’t wait for the 60 Hz rendering update.

Does this drain the battery?

Holding the display at 120 Hz costs battery, which is why F’kih enables the tricks only during touches and animations. The OffscreenCanvas step is light on its own, per the article.

Does it work on Android?

The techniques run there, but one developer found the canvas demo worse on Android. Test on real devices before you rely on it.

Do I need this for a normal website?

Probably not. Scrolling and CSS animations already run on the compositor. The steps matter for drags, gestures and canvas or WebGL work.

Sources