Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 687
Regex Rookie Avatar asked Feb 10 '26 15:02

Regex Rookie


1 Answers

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).

like image 192
casablanca Avatar answered Feb 12 '26 15:02

casablanca