3
I’m having trouble checking if firefox ran the.execCommand element command ('Copy', false, null).
This check is being done correctly in Chrome (which does not allow) and IE (which allows).
Could you help me, please?
Follows the relevant part of the Code:
editorDoc.body.focus();
editorDoc.execCommand ('SelectAll', false, null);
if( ! editorDoc.execCommand ('Copy', false, null) )
alert('As opções de segurança do seu navegador impedem a cópia do conteúdo de maneira automática. Por favor, utilize [CTRL]+[C] em seu teclado.');
You can test the current operation here: https://tmwxd.com.br/minify.php
Obs Importante: In the firefox the text is selected in Chrome the text is selected and the alert is issued, and IE 11 text is selected and copied to clipboard.
There are other ways to do this, see here.
– bfavaretto
Thanks, but I needed a solution for execCommand , since it is a text editor. What’s more, it’s only firefox that "copy" doesn’t work.
– Szag-Ot
I’ve been reading the MDN documentation and so that the
execCommand
function, it is necessary to use the property designMode with the valueOn
. You already did that?– stderr
Yes, @Qmechanic73... I am and execCommand is working, as mentioned above. The problem is that FF does not allow auto-scoping. So far td well, because Chrome tb does not allow it. But execCommand should turn false when it does not execute, to make a message possible. Chrome does that, but FF doesn’t.
– Szag-Ot