Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Pass the query parameters down to iframe

A topic by matte created 88 days ago Views: 88
Viewing posts 1 to 1
(+3)

It would be really cool to be able to pass some data to HTML5 games through query parameters, and it seems to be close to a one-line change (just append these when generating iframe src URL).

That would help put the game or tool into a certain state, for example to:

  • immediately join certain private room in online game
  • start from specific level
  • share the save between multiple devices and players

My personal use-case would be a cross-device game that should be played on both PC and smartphone, with an easy connection via QR-code with session ID encoded in the itch.io game URL. Currently that would require me to host the game somewhere else, or players to establish the connection manually.

There is a workaround of using the iframe src URL that itch generates as the base URL to use with query parameters, but there is no guarantee that the URL won't change, it skips the itch page of the game, and degrades the user experience.