Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+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.