Browser games

Making Browser Games Work on Phones: Touch, Fullscreen and Mobile Safari

To make a browser game work well on phones, design for touch from the start, stop the page from scrolling or zooming under the player's fingers, handle the changing viewport and safe areas, start audio from a user gesture, cap the canvas resolution, keep memory low, and test on real iPhones and Android phones. Fullscreen and orientation lock behave differently across mobile browsers, so treat them as enhancements and make the game work without them.

A large share of players for advergames, portal games and shared links arrive on a phone. A game that is great on desktop but scrolls, zooms, stays silent or crashes on mobile loses them in seconds. This guide collects the practical fixes we apply in our browser game development projects, whatever framework the game uses.

Design for touch first

Retrofitting touch onto a keyboard game rarely works. Decide early how the game will be played with fingers:

  • Tap and swipe games such as puzzles, runners and card games translate naturally.
  • Virtual sticks and buttons work for action games but need careful sizing, placement and feedback.
  • Drag and aim controls suit slingshot, physics and strategy games.

Keep touch targets large, keep them away from screen edges where system gestures live, and give visible feedback on every press. Our guide to designing touch controls goes deeper on virtual sticks and button layouts.

On the technical side, use Pointer Events, which unify mouse, touch and pen input, and track pointers by ID so multi-touch works. Test what happens when a finger slides off a button or leaves the canvas.

Stop the page from fighting the game

The most common mobile bug is the page itself moving: scrolling, pinch zooming, pull-to-refresh, text selection or the long-press menu. Fix it in layers:

  1. Set a viewport meta tag with width set to device-width and an initial scale of one.
  2. Apply the CSS property touch-action: none to the game canvas so the browser does not treat touches as scroll or zoom gestures.
  3. Prevent overscroll and pull-to-refresh with overscroll-behavior on the page.
  4. Disable text selection and the touch callout on the game area.
  5. Make the game fill the visible viewport so there is nothing to scroll.

If the game is embedded in an iframe on a brand site or portal, apply these inside the game and ask the host page to size the iframe sensibly.

Handle the viewport, notches and safe areas

Mobile browsers show and hide their address bars as the user interacts, which changes the visible height. Use dynamic viewport units such as dvh or listen for resize and visual viewport changes, then resize the canvas. Do not assume the height you read at load time stays fixed.

Phones with notches, camera cutouts and rounded corners can hide parts of the screen. Add viewport-fit=cover to the viewport meta tag and use the CSS env(safe-area-inset-*) values to keep buttons and HUD elements inside the safe area.

Fullscreen and orientation

The Fullscreen API and Screen Orientation API are well supported on Android browsers. On iPhone, support for making arbitrary page elements fullscreen has historically been limited, and orientation locking from a web page is not generally available. Support changes between browser versions, so check current compatibility data before relying on either.

Practical approach:

  • Design the game to work in the browser's normal view, with the address bar visible.
  • Offer a fullscreen button where the API is available, triggered from a tap.
  • Support both orientations, or show a friendly "rotate your device" overlay when the game needs one.
  • If players return often, consider a web app manifest so the game can be added to the home screen and launched without browser chrome.

Audio on mobile

Mobile browsers block audio until the user interacts with the page. Create or resume your Web Audio context inside the first tap, typically on a "tap to play" start screen. That screen is also a natural place to request fullscreen.

Also handle interruptions. When the player switches apps, takes a call or locks the phone, pause the game and audio using the Page Visibility API, then resume cleanly. On iPhone, the hardware silent switch can affect web audio behavior; test with it in both positions.

Canvas resolution and performance

Phones have high pixel densities. Rendering the canvas at full device resolution can mean drawing several times more pixels than a desktop window, on a weaker GPU that also throttles when it heats up.

  • Cap the render resolution, for example by limiting the device pixel ratio you render at, and let the browser scale the canvas up.
  • For pixel art games, render at a low internal resolution and scale by whole numbers.
  • Offer quality settings or adapt automatically when frame times climb.
  • Cap the frame rate on high refresh rate screens if the game does not need it, to save battery and heat.
  • Pause rendering entirely when the tab is hidden.

Memory: the silent crash

Mobile browsers, especially on iPhone, can reload or kill a tab that uses too much memory, often without a visible error. To the player the game simply restarts or goes blank. Large textures, uncompressed audio and big WebAssembly heaps from engine exports are the usual causes.

Keep texture atlases sized for mobile, stream levels rather than loading everything at once, use compressed audio, and watch memory on real devices during long sessions. Our guide to making a browser game load fast covers asset budgets, and porting a Unity game to WebGL covers engine exports specifically.

Browser differences to test

AreaWhat to check
Safari on iPhone and iPadFullscreen behavior, audio unlock, memory limits, safe areas, WebGL and WebGPU support in the current version
Chrome on AndroidPerformance on mid-range devices, fullscreen and orientation, back button behavior
In-app browsersGames opened from social apps run inside embedded browsers with their own quirks and toolbars
Low-power modesFrame rate caps and throttling when battery saver is on

All browsers on iOS have historically used Apple's WebKit engine, so a bug in Safari usually appears in Chrome on iPhone as well. Policies around this have been changing in some regions, so do not assume and test both.

Mobile browser game checklist

  • Controls designed for touch, using Pointer Events with multi-touch.
  • No scrolling, zooming, pull-to-refresh or text selection on the game area.
  • Canvas resizes with the dynamic viewport and respects safe areas.
  • Works without fullscreen; fullscreen offered where supported.
  • Both orientations handled, or a clear rotate prompt.
  • Audio unlocked on the first tap; game pauses when hidden.
  • Render resolution capped; frame rate reasonable on mid-range phones.
  • Memory tested in long sessions on real iPhones and Android phones.
  • Tested inside common in-app browsers if links will be shared on social media.

When to bring in a studio

If your game is a simple tap game, the checklist above may be all you need. Bring in a studio when an existing desktop game has to work on phones, when an engine export is too heavy for mobile browsers, or when a branded campaign needs to work reliably on whatever phone a customer happens to own.

paxl.co builds HTML5 and WebGL games that are tested on real phones from the first playable build. A typical project takes 3–4 months from kickoff to launch. See our HTML5 and WebGL browser game development services, or read our practical guide to HTML5 game development for the wider picture.

FAQ

Why does my browser game have no sound on iPhone?

Mobile browsers block audio until the user interacts with the page. Resume or create the audio context inside a tap handler, such as a start button, and check that the device's silent switch is not affecting playback.

Can a browser game force landscape mode on mobile?

Some Android browsers allow orientation locking once the game is fullscreen, but it is not reliably available everywhere, especially on iPhone. Support both orientations or show a prompt asking the player to rotate the device.

Why does my game reload by itself on iPhone?

The browser has most likely reclaimed memory from the tab. Reduce texture sizes, avoid loading every asset at once and check the memory footprint of any engine export on a real device.

Planning something like this?

See how paxl.co handles browser & webgl games, or tell us about your project and we will reply within two working days.

Keep reading