The Spectrum Dispatch News

technology

Developer shows how to bypass iOS Safari's 60 FPS limit for web apps

A technique uses invisible scroll controllers to achieve 120 Hz input and rendering on high-refresh iPhones, enabling web apps that feel more native.

Developer shows how to bypass iOS Safari's 60 FPS limit for web apps

iOS Safari limits requestAnimationFrame to 60 Hz on 120 Hz screens unless a buried developer flag is enabled, making even well-designed web applications feel sluggish compared to native apps. A developer documented a method to work around this limitation by leveraging the browser’s compositor—the system component responsible for smooth scrolling that runs independently of JavaScript.

Developer shows how to bypass iOS Safari’s 60 FPS limit for web apps

The core insight is that Safari’s compositor handles scrolling at high refresh rates without requiring JavaScript intervention. By using invisible scrollable containers as “controllers,” developers can read scroll position values synchronously rather than relying on scroll events, which fire at only 5 to 26 times per second during momentum scrolling.

The developer experimented with multiple approaches to extract scroll positions at high frequency. A recursive MessageChannel produced 50,000 reads per second but wasted resources. Using Atomics to synchronize with the screen refresh rate worked but required COOP/COEP headers that break cross-origin assets. The final solution used a MessageChannel throttled to the device’s refresh rate and phase-locked to vsync using requestAnimationFrame timestamps, achieving 80 position reads per second.

Further optimizations increased this to 90 reads per second by ensuring Safari flushes scroll position updates on rendering ticks. To reach the full 120 Hz on ProMotion-capable devices, the technique uses a small invisible CSS animation scrolling in the background, which signals the GPU to maintain 120 Hz rendering when interactions occur.

One remaining challenge is that scrollTop and scrollLeft are rounded to the nearest integer, losing sub-pixel precision. Scaling the scrollable surface by the device pixel ratio and scaling its container back down recovers this precision.

While high-frequency input is now achievable, the DOM still updates at 60 Hz maximum, requiring developers to handle more complex interactions differently. Dragging interactions leverage the controller system, and predefined animations use CSS. However, computation-derived layouts and canvas rendering remain limited to 60 FPS—a fundamental constraint without enabling the iOS Safari feature flag.

Key facts

  • iOS Safari caps requestAnimationFrame at 60 Hz on 120 Hz screens by default
  • Invisible scroll containers can be used as high-frequency input controllers
  • The technique achieves 90 position reads per second through synchronized MessageChannel calls
  • A background CSS animation can trigger 120 Hz rendering on ProMotion devices
  • Canvas and computation-derived rendering remain limited to 60 FPS without system flags

Sources

← All posts