How your game appears on Good Browser Games
Players can reach your game in three ways. You can give us one or more of them when you submit your game.
1. Upload an HTML5 build (recommended)
We host your game files. Players play on your game page, and you get leaderboards, visit counts and playtime. Submit the game first, then upload a .zip of your web export from My games or with the developer API. You do not need an embeddable URL if you upload a build.
2. Embeddable URL
Use this when your game already runs on a web page of its own. Your game page shows a Play button. When a player presses it, we load your URL in a frame on that page, so the player stays on Good Browser Games.
What makes a good embeddable URL
- The page shows only the game: no site header, menus, comments or ads around it. The game fills the page and resizes to fit the frame.
- It starts with
https://. - Your server lets other sites frame it. The browser blocks the frame if the page sends
X-Frame-Options: DENYorSAMEORIGIN, or aContent-Security-Policywhoseframe-ancestorsdoes not includehttps://goodbrowsergames.com.
Examples
- Good:
https://example.com/games/star-hopper/, a page with only the game on it. - Good:
https://cdn.example.com/star-hopper/index.html, the index file of your web export. - Good:
https://example.com/embed/star-hopper, an embed page you made for other sites. - Not good: your home page, a store page, a page with the game in the middle of other content, or a download link. Put those in the public game URL instead.
Test it yourself
Our player frames your page with the sandbox below. Save this in a local .html file, put your URL in it, and open it in a browser. If the game loads and plays, the URL works.
<iframe src="YOUR_URL" width="960" height="600" allow="fullscreen; autoplay; gamepad; clipboard-write" allowfullscreen sandbox="allow-scripts allow-same-origin allow-pointer-lock allow-forms allow-popups allow-orientation-lock allow-modals"></iframe>
Count play time
Your stats show active play time. Our page cannot see input inside your frame, so without help it counts time only while the frame has focus, and stops 10 minutes after the mouse last crossed the frame. A game that locks the pointer loses long sessions this way. To count them, post a message to the game page when the player gives input. Send it at most once every 15 seconds, and only to our origin:
var sent = 0;
function reportInput() {
if (window.parent === window || Date.now() - sent < 15000) return;
sent = Date.now();
window.parent.postMessage({ gbg: "input" }, "https://goodbrowsergames.com");
}
["pointerdown", "pointermove", "keydown", "wheel"].forEach(function (type) {
addEventListener(type, reportInput, { capture: true, passive: true });
});Uploaded HTML5 builds do this already. You do not need to add it to a build.
3. Public game URL (optional)
The page where people can play or get your game on your own site, such as your website, your itch.io page or a store page. It is optional, but we recommend it: we link to it from your game page, which helps players find you and gives your game more visibility. If you give no build and no embeddable URL, the Play button opens this page in a new tab.