Check if copy and paste is enabled

In Firefox (at least) JavaScript copy and paste features are disabled by default. Is there anyway to check if functionality is available, so I can hide some buttons if it is not?

+3
source share
1 answer

Tested in IE8, FF3.6.10, Chrome 3.0.195. Safari 4.0:

if(typeof(window.clipboardData)=="undefined") {
  alert("not working")
}
else {
  alert("working")
}
0
source

Source: https://habr.com/ru/post/1761105/


All Articles