diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-02-08 10:48:01 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-02-08 10:48:01 -0500 |
| commit | 2e48741de964422956fb81e474cf6303652ceefd (patch) | |
| tree | 23cc8c142aa4779e60c302211777f1aff960480f | |
| parent | f8e4a8c85890648f38dc8705e700d63252bb1dc2 (diff) | |
| -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> |
