'JS - Copy to clipboard without user action [duplicate]

I'm making an extremely simple small page that uses prompt to get a numerical input from the user and then uses that to copy certain data to the clipboard. However, the async Clipboard API does not allow this, as it is "not user triggered", and I'm hoping to avoid execCommany("copy") for simplicity (as it necessitates elements on the page). Is it possible to do this? Can the prompt window be properly recognized as being user input and allowed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source