Skip to main content

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

Please grant clipboard-write permission to iframe of web games

A topic by AlSoKnown created Jun 28, 2025 Views: 952 Replies: 9
Viewing posts 1 to 8
(1 edit) (+5)

I develop a web-based game which uses ‘copy savefile as a text to clipboard’ as a method to allow players to share/transfer their savefiles, as well as a tool for bug reporting/reproduction.

It turned out that this feature does not work on Chrome due to lack of clipboard-write permissions in ‘allow’ attribute of iframe tag of the itch.io game page. (See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations )

I believe this addition will not affect security, since:

  1. Firefox and Safari do not support this permission and just allow clipboard.writeText always
  2. The iframe tag already allows practically everything else.
(+2)

I fully support adding clipboard-write to iframe permissions on Itch.io. Clipboard access is essential for features like savefile export or bug report tools. Chrome blocking this breaks user experience unnecessarily, especially when other browsers allow it by default. If it's opt-in for devs and handled securely, it would boost functionality without compromising trust or safety.

(1 edit)

+1

Even the itch app allows HTML5 projects to use clipboard.

I just got bitten by this today.  Had to use a hacky workaround.  Please add this feature.

(+1)

hey! mind sharing the hacky workaround you ended up using?

(+1)

The text you want to copy needs to be in  a textarea element.  It can be hidden until you need to do the copy and be made temporarily visible while you do the copy.

var range = document.createRange()

range.selectNode(document.getElementById("#myTextArea"))

window.getSelection().removeAllRanges()

window.getSelection().addRange(range)

 document.execCommand('copy')

 window.getSelection().removeAllRanges()

You can google document.execCommand('copy') to get info on why this works. 

Please add this feature! Thanks :)

+1 from me, I have a level sharing feature based on clipboard interactions. Thank you! 🙂

+1. I have a button where users can share maps to one another. It copies the share URL to the clipboard.

example:
https://html-classic.itch.zone/html/17159889/productionExecutable/index.html?sce...

+1