Domanda

Searching the web I have found a lot of old resources about this issues. I hope this won’t be considered as a duplicate but I could not found any answers with new content.

Since browsers and JS is constantly improving I want to know if there is any chance to copy the content to clipboard using only Javascript and Clipboard API no Flash plugins.

È stato utile?

Soluzione

The limitations on the use of the clipboard are related to security so I fear that any further "improvement" will simply reduce the possible operations.

What you can do now is to access the clipboard to do cut/copy/paste using an hidden text field but the operation must be started using the standard hotkey (e.g. ctrl-x/ctrl-c/ctrl-v) by the user. The idea is that a program should not be able for example to access the current content of the clipboard unless the user knows this is happening (because s/he typed ctrl-v).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top