What your game can and cannot do in the browser
The security rules every game runs under (own origin, content security policy, framing, permissions) and how to build so your game just works.
In short
- Every game runs on its own address,
https://<your-link>.oneprompt.games, isolated from other games and from players' accounts. - Your game may load scripts, styles, fonts and data only from its own package. Images, audio and video may also come from PlayServ (any
https://*.playserv.comaddress, for example pictures your PlayServ game server picks). Third-party scripts, CDNs, web fonts and images from other sites are blocked: copy what you need into the package or serve it through PlayServ. - Network requests (fetch, XHR, WebSocket) are allowed to your own game address, the OnePrompt API and PlayServ only. PlayServ (playserv.io) is where multiplayer, player accounts and game data run; your game may connect to the PlayServ platform at
https://platform.playserv.com(including the game-server gatewaywss://platform.playserv.com/games/<slug>) and to PlayServ's pooled game servers (*.pool.playserv.com, any port). Other servers cannot be reached from the game. - Camera, microphone, location, payments and USB are switched off. Fullscreen, gamepads, autoplay after a click and wake lock work inside the play page.
These rules protect players from malicious games and make sure every game behaves the same way. Building with them in mind from the start avoids the classic "works on my machine, blank screen on OnePrompt" moment.
Your game's own address
Each game is served from its own origin, for example https://star-hopper.oneprompt.games. Because the origin is unique, your game's storage (localStorage, IndexedDB, cookies you set) is separate from every other game's and from the OnePrompt website itself. Nothing on that origin can read a player's OnePrompt sign-in.
Some practical consequences:
- Use relative URLs for your files. The content root is served at
/. - Saved games in
localStorageorIndexedDBwork and stay on the player's device for that origin. - The path
/__oneprompt/belongs to the platform (the bridge SDK lives at/__oneprompt/bridge.js). You cannot put your own files there. - Files are served with
Cache-Control: no-cacheand ETags, so a new release is picked up immediately and a promotion never mixes files from two builds. - Correct content types are set for web files, including
.wasm, and byte ranges are supported for large media. - Search engines are told not to index the game origin (
X-Robots-Tag: noindex), so your ranking builds up on your game page instead.
The content security policy
Every response from your game origin carries a content security policy (CSP). In plain words, it allows:
- Scripts from your own origin, including inline scripts,
eval, WebAssembly andblob:URLs. Engines like Unity and Godot work out of the box. - Styles from your own origin, including inline styles.
- Images, audio and video from your own origin,
data:andblob:URLs. - Fonts from your own origin and
data:URLs. - Network requests (
fetch, XHR, WebSocket) to your own origin, the OnePrompt API, the PlayServ service, andblob:anddata:URLs. - Workers from your own origin and
blob:URLs. - Frames inside your game from your own origin only.
It blocks everything else, including:
- scripts, fonts or stylesheets from CDNs (for example Google Fonts or a JavaScript library loaded from a CDN);
- images or audio hot-linked from other sites;
- requests to your own backend, a third-party leaderboard service, analytics or ad SDKs on other domains;
- embedding a YouTube video or another site inside your game;
<object>and<embed>plugins;- forms that post to other sites.
How to comply: bundle every library, font and asset into your package. Most build tools can do this with one setting (for example, install the font file instead of linking to a font service, and import libraries through your bundler instead of a CDN script tag). Your game page can still have a trailer: that is shown on the landing page, not inside the game.
Online services come through PlayServ, the multiplayer backend OnePrompt is part of, which your game is allowed to reach: rooms and matchmaking, player accounts, game data and server functions. You build them with PlayServ's own SDK and documentation; see The bridge SDK, analytics and PlayServ.
Framing and the play page
Players play your game on https://oneprompt.games/play/<your-link>, which shows your game in a frame together with the timer, price, report and exit buttons. Only that play page (and your own origin) may frame your game; other websites cannot embed it.
The frame allows autoplay, fullscreen, gamepads, writing to the clipboard and screen wake lock. The play page also has its own Fullscreen button. Some practical tips:
- Browsers only allow sound after the player interacts. Start audio after the first click or key press.
- Keep your game responsive to the size of its window; the frame fills the play area.
- Do not try to navigate the top window or break out of the frame.
Games with cross_origin_isolation: true are the exception: they are opened in the full browser window instead of a frame. See Package your game.
Disabled device features
Camera, microphone, geolocation, the Payment Request API and WebUSB are disabled for all games. Gamepads, keyboard, mouse and touch work normally.
Who can open the game origin
The game origin does not serve every game to everyone:
- Published, open, free games can be opened directly on their own address by anyone, as well as from the play page.
- Drafts and games in review are visible only to your team, through a team preview link (Dashboard → your project → Open game).
- Invite-only and premium games are served only after the play page hands the browser a short-lived, signed pass. Opening their address directly shows a page that links to the game page instead.
This is enforced by our servers, so you do not need to build any access checks into your game.
Rules from the content policy
Beyond the technical limits, the Community & Content Policy asks games to:
- run in the browser from the files you deployed, without asking players to install native software;
- stay inside their own origin and not interfere with the play page or imitate platform messages about price, credits or consent;
- not mine cryptocurrency, phish, collect personal data covertly or fingerprint players;
- not sell anything inside the game, and not link to off-platform payments for game content or access (links to your own website, community or social channels are fine).
A quick pre-flight checklist
- Open your built
index.htmlfrom a local web server (not fromfile://) and check the browser console for blocked requests. - Search your build for
https://URLs. Each one that points to another site is a candidate for blocking; bundle it or remove it. - Start audio only after a click.
- Deploy, then use Open game in the dashboard and check the browser console there as well.