Copying to clipboard within an iframe

I’m coding a script/extension for a browser game I’m currently playing. In the game you can press a button that automatically copies a code/string to your clipboard. I would like to modify said string.

The problem I am currently running into is that the game is hosted on a site that uses an iframe within an iframe and while I already have a working solution for the game itself (you can play the game by accessing the source url of the innermost iframe), trying to run this solution on the host site gives me the following error:

“undefined:The Clipboard API has been blocked because of a permissions policy applied to the current document. See goo.gl/EuHzyv for more details.”

I have already tried the approach outlined in this post, but it doesn’t work, so here is my question:

When using the solution in the linked post for nested iframes, what origin url needs to be used?

   <iframe src="url1" allow="clipboard-read; clipboard-write self [what url goes here]>
      <iframe src="url2" allow="clipboard-read; clipboard-write self [what url goes here]
         <canvas for game with button that copies something into clipboard>
      </iframe>
   </iframe>