Search code examples
javascriptdomclipboarddata

window.clipboardData is not part of Javascript?


In my search for a Javascript way to programmatically select WebView content, I encountered this Javascript code snippet, which uses a method named setData() in a member named clipboardData in the window object.

But when I tried to find documentation for it in a Javascript reference, clipboardData was nowhere to be found.

Why?

Isn't window.clipboardData not part of Javascript or DOM?


Solution

  • No, it's not part of any standard. Except for IE, most browsers don't allow clipboard access because of security concerns (you don't want arbitrary webpages reading something sensitive information that you put into your clipboard).