Blog

"Your browser is not supported": checking the user agent

Window and behavior · · 6 min read

When a site shows an unsupported-browser page inside a Pake app, check whether it is rejecting the user agent string. You can try a string from a browser the site accepts in User agent under Advanced. This changes how the app identifies itself, not its web engine or capabilities.

Why sites check the user agent

Every request a browser sends carries a User-Agent header. MDN describes it as a string that lets servers identify the application, operating system, vendor and version making the request. Some sites read it and turn away anything they do not recognize, which is how an app built on the system web view can land on a "please use Chrome" page while the same site works in Safari or Edge.

MDN's guide to browser detection using the user agent calls this UA sniffing and says it is very hard to do reliably and often a cause of bugs, partly because browsers routinely pretend to be another browser. It recommends feature detection instead: check whether a feature is available, and use a fallback when it is not. A site that sniffs can be satisfied by a different string. A site that detects features, or that has other reasons to refuse, will not be.

What Pake sends by default

The User agent field in Advanced is empty for a new app, and the field shows a hint that reads Default Safari user agent on Mac and Default Chrome user agent on Windows. Empty means Pake uses its built-in string for the platform. In the Pake version checked for this guide, that is a Safari 26.0 string on a Mac and a Chrome 147.0.0.0 string on Windows, so on each system the app already presents itself as a common desktop browser. Most sites never need more.

The string is a label, not an engine. Pake draws pages with the system web view, which is WebKit on a Mac and WebView2, the Chromium-based runtime, on Windows. The Windows string says Chrome, but the engine is whichever WebView2 runtime is installed, and Microsoft updates it separately from Pake. That gap is why a version number in a string can look current while a site's real feature check still fails.

How the setting reaches the page

Pake passes the string to the web view when it creates the window. From then on it is what the site sees in the User-Agent request header and in navigator.userAgent in the page's scripts, for every page the app opens. It is a single value for the whole app: there is no per-page or per-domain choice, and it does not change which engine renders the page. Pake treats it as an app setting, so it needs Save Changes and a reopen of the app to take effect, as for any other option.

Set a user agent for one app

For a new app, open Advanced on its page before you click Create App. For an app you already made, go to My Apps, click Edit, open Advanced, change the field, then click Save Changes. Editing reinstalls the same app in place, so it keeps its sign-ins. To go back, clear the field and save again. See Create an app and Manage your apps.

Copy the string from a browser the site accepts instead of typing one from memory. Open that browser's developer console on any page and run:

navigator.userAgent

MDN's navigator.userAgent page confirms it returns the user agent string for the current browser. Paste the result into User agent.

For example, MDN lists this as a desktop Chrome string:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Treat it only as a picture of the format. Version numbers move with every browser release, and some sites refuse a version they consider old, so copy a current string from your own browser.

Check that it worked

To confirm the change, use a build that has developer tools. With the CLI, add --debug and open the tools with the shortcut for your system, Command, Option and I on a Mac or Ctrl, Shift and I on Windows, then run navigator.userAgent in the console. The tools are only available in debug builds, so use a throwaway build for this and keep your normal app clean. If the string matches what you set but the site still refuses you, the string was not the reason, so put the field back to empty and look at the cases below.

When a user agent does not help

  • The site tests features. If the page checks for an API the web view lacks, a different name changes nothing. A string that claims Chrome on a WebKit view can also make the site send code the view cannot run, so if pages break after the change, clear the field.
  • The site reads something else. Browsers also expose a separate interface, navigator.userAgentData, which MDN marks as limited availability because it does not work in some of the most widely used browsers. If a site uses this interface, check its actual return value separately from the user agent string.
  • The provider refuses embedded sign-in. Google, among others, blocks sign-in inside embedded web views as a matter of policy, and changing the user agent is not a supported way around that. Use the site in your browser or its official client, and see the sign-in guide and the FAQ. If a sign-in pop-up simply goes nowhere on Windows, try Open new windows in the app under Behavior first.
  • A bot check loops. The CLI FAQ notes that Cloudflare challenges in front of some sites, ChatGPT among them, can flag the system web view and loop without passing even with a custom user agent. The challenge is detecting the engine, so there is no reliable fix inside Pake.

The CLI flag

With the CLI set up, pass the string at build time:

pake https://example.com --name Example --user-agent "<paste a current user agent here>"

--user-agent is empty by default. The CLI FAQ lists it as the first thing to try when sign-in, uploads or other site features fail, next to --inject for small script fixes. See the CLI options. For other window and page adjustments, see customizing the window.

FAQ

Is it safe to pretend to be Chrome on a Mac?

It is allowed, but it can backfire. A site that believes it is talking to Chrome may send code written for Chrome's engine, which the Mac's WebKit view may not run. If pages break, clear the field.

Does the user agent change per website?

No. One string covers the whole app. Make a separate app if two sites need different strings.

Will my user agent keep working after the browser updates?

Not by itself. Pake sends the exact text you saved, so a site that starts requiring a newer version will need you to copy a fresh string.