by ihuman · 11y ago · 0 comments
Couldn't you bypass this by creating an invisible button, and then simulating a click event?
I'm sure it's tricky to ensure this, though. Like pop-up blocking.
I guess Mozilla have weighed up the convenience/security balance of browser control of the clipboard, and have put in a minimal protection scheme to make it clear that code should not play with it behind the user's back, but Mozilla knows that they can't really stop it.
How? This security mechanism has been used for (among other things) popups for years now, and the only way it's been worked around is by attaching click handlers to links the user is likely to click.
Basically, the user will click something at some point, the page can then unexpectedly put malicious stuff into the clipboard. No amount of protecting will stop this.