1

I have a function I use to intercept CTRL+V and COMMAND+V:

    function paste() {
        clip.val('').focus();
        //wait until Browser insert text to textarea
        self.oneTime(100, function() {
            self.insert(clip.val());
            clip.blur().val('');
        });
    }

clip is hidden textarea, right now it's hidden using black div on top of it (the only way I found to fix Andorid). And in keydown event I call that function:

} else if (e.which === 86) {
    //CTRL+V
    paste();
    return true; // I return true because I have return false at the end
                 // of keydown event
}

But seems that it don't work on MacOSX Safari as you can check in this issue on github. Anybody know why is that happening and how to fix it?

jcubic
  • 61,973
  • 54
  • 229
  • 402
  • Have you tried using http://stackoverflow.com/questions/1226574/disable-copy-paste-into-html-form-using-javascript – Etheryte Jul 27 '14 at 16:12
  • @Nit thanks for the link, will check onpaste event. – jcubic Jul 27 '14 at 16:36
  • @Nit I've used onpaste but it don't work at all in FireFox, work in Chrome. – jcubic Jul 27 '14 at 17:48
  • I've tested the linked answer both on OS X Firefox & Safari and it works just fine. Either you've implemented the linked answer wrong or your problem lies elsewhere in your code logic. – Etheryte Jul 28 '14 at 10:10
  • @Nit created the code using paste event again and it work also in FF. – jcubic Aug 01 '14 at 16:47

0 Answers0