diff options
Diffstat (limited to 'assets/test/clipboard.html')
| -rw-r--r-- | assets/test/clipboard.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/assets/test/clipboard.html b/assets/test/clipboard.html index 9f70d89..c1c3294 100644 --- a/assets/test/clipboard.html +++ b/assets/test/clipboard.html @@ -17,6 +17,9 @@ document.body.addEventListener('copy', function (e) { document.body.addEventListener('paste', function (e) { + // firefox does not have e.clipboardData.items, + // to get paste data use e.clipboardData.getData("text/html") + // only works with text.. toArray(e.clipboardData.items).forEach(function(item,i){ console.log(item.kind, item.type) if (item.kind == 'file' && item.type.match('image/')) { @@ -35,7 +38,7 @@ document.body.addEventListener('paste', function (e) { } img.src = blobUrl; } - // this can be text/plain or text/html.. + // this can be text/plain or text/html else if (item.kind == 'string') { item.getAsString(function(text){ var node = document.createElement('span') @@ -48,4 +51,4 @@ document.body.addEventListener('paste', function (e) { } }) }) -</script>
\ No newline at end of file +</script> |
