no se puede ejecutar el comando window.document.execCommand("pegar") entre paréntesis
Frecuentes
Visto 226 equipos
0
I wrote a plugin in brackets in which I want to copy text from the text box and paste in the current opened document .
window.document.execCommand("copy");
if I use keyboard command+v its working, I am able to paste the text which is copied by the above dom command.
But the same result I'm not able to get by window.document.execCommand("paste")
, even though I tried this CommandManager.execute(Commands.EDIT_PASTE)
usted me podría ayudar por favor.
Regards Ashish.
1 Respuestas
0
Those commands won't work because Brackets runs in a Chromium webview, and Chromium doesn't permit normal content to access the clipboard programmatically - as a security measure. In Brackets the security rationale isn't really relevant, but someone would need to patch brackets-shell to disable the restriction, and that work hasn't happened yet.
But there's a workaround: Brackets extensions have access to NodeJS, so you can use a Node package like copiar pegar to access the clipboard. Check out the source of the extensions Right Click Extended or File Info to Clipboard por ejemplo.
contestado el 28 de mayo de 14 a las 16:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas jquery dom npm brackets-shell or haz tu propia pregunta.