Clipboard API

Clipboard API

API to provide copy, cut and paste events as well as provide access to the OS clipboard.

Spec http://www.w3.org/TR/clipboard-apis/
Status W3C Working Draft
IE Edge Firefox Chrome Safari Opera
    57 (6) 62 (5,7)    
    56 (6) 61 (5,7) TP (2,5) 48 (5,7)
  16 (1,2,5) 55 (6) 60 (5,7) 11 (2,5) 47 (5,7)
11 (1,2,5) 15 (1,2,5) 54 (6) 59 (5,7) 10.1 (2,5) 46 (5,7)
10 (1,2,5) 14 (1,2,5) 53 (6) 58 (5,7) 10 (2,5) 45 (5,7)
9 (1,2,5) 13 (1,2,5) 52 (6) 57 (5,7) 9.1 (2,3,5) 44 (5,7)
8 (1,2,5) 12 (1,2,5) 51 (6) 56 (5,7) 9 (2,3,5) 43 (5,7)
Show all
7 (1,2,5)   50 (6) 55 (5,7) 8 (2,3,5) 42 (5,7)
6 (1,2,5)   49 (6) 54 (5,7) 7.1 (2,3,5) 41 (5,7)
5.5 (1,2,5)   48 (6) 53 (5,7) 7 (2,3,5) 40 (5,7)
    47 (6) 52 (5,7) 6.1 (2,3,5) 39 (5,7)
    46 (6) 51 (5,7) 6 (2,3,5) 38 (5,7)
    45 (6) 50 (5,7) 5.1 (2,3,5) 37 (5,7)
    44 (6) 49 (5,7) 5 (2,3,5) 36 (5,7)
    43 (6) 48 (5,7) 4 (2,3,5) 35 (5,7)
    42 (6) 47 (5,7) 3.2 34 (5,7)
    41 (6) 46 (5,7) 3.1 33 (5,7)
    40 (2,3) 45 (5,7)   32 (5,7)
    39 (2,3) 44 (5,7)   31 (5,7)
    38 (2,3) 43 (5,7)   30 (5,7)
    37 (2,3) 42 (3,5)   29 (3,5)
    36 (2,3) 41 (3,5)   28 (3,5)
    35 (2,3) 40 (3,5)   27 (3,5)
    34 (2,3) 39 (3,5)   26 (3,5)
    33 (2,3) 38 (3,5)   25 (3,5)
    32 (2,3) 37 (3,5)   24 (3,5)
    31 (2,3) 36 (3,5)   23 (3,5)
    30 (2,3) 35 (3,5)   22 (3,5)
    29 (2,3) 34 (3,5)   21 (3,5)
    28 (2,3) 33 (3,5)   20 (3,5)
    27 (2,3) 32 (3,5)   19 (3,5)
    26 (2,3) 31 (3,5)   18 (3,5)
    25 (2,3) 30 (3,5)   17 (3,5)
    24 (2,3) 29 (3,5)   16 (3,5)
    23 (2,3) 28 (3,5)   15 (3,5)
    22 (2,3) 27 (3,5)   12.1 (3)
    21 26 (3,5)   12
    20 25 (3,5)   11.6
    19 24 (3,5)   11.5
    18 23 (3,5)   11.1
    17 22 (3,5)   11
    16 21 (3,5)   10.6
    15 20 (3,5)   10.5
    14 19 (3,5)   10.0-10.1
    13 18 (3,5)   9.5-9.6
    12 17 (3,5)   9
    11 16 (3,5)    
    10 15 (3,5)    
    9 14 (3,5)    
    8 13 (3,5)    
    7 12    
    6 11    
    5 10    
    4 9    
    3.6 8    
    3.5 7    
    3 6    
    2 5    
      4    
iOS Safari Opera Mini Android Browser Blackberry Browser Opera Mobile Android Chrome Android Firefox IE Mobile Android UC Browser Samsung Internet QQ Browser Baidu Browser
11 (2,3,5)                      
10.3 (2,3,5) all 56 (2,5) 10 (2,5) 37 (4,5) 59 (5) 54 (4) 11 11.4 5 (5) 1.2 (5,7) 7.12 (5)
10.0-10.2 (2,3,5)   4.4.3-4.4.4 (2,5) 7 12.1     10   4 (2,5)    
9.3 (2,3,5)   4.4 (2,5)   12              
9.0-9.2 (2,3,5)   4.2-4.3   11.5              
Show all
8.1-8.4 (2,3,5)   4.1   11.1              
8 (2,3,5)   4   11              
7.0-7.1 (2,3,5)   3   10              
6.0-6.1 (2,3,5)   2.3                  
5.0-5.1 (2,3,5)   2.2                  
4.2-4.3   2.1                  
4.0-4.1                      
3.2                      

Notes

Internet Explorer will display a security prompt for access to the OS clipboard.

Chrome 42+, Opera 29+ and Firefox 41+ support clipboard reading/writing only when part of a user action (click, keydown, etc).

Firefox 40- users can enable support with a security preference setting.

  1. Only supports Text and URL data types and uses a non-standard method of interacting with the clipboard.

  2. Only fires copy event on a valid selection and only cut and paste in focused editable fields.

  3. Only supports OS clipboard reading/writing via shortcut keys, not through document.execCommand().

  4. Only supports paste event (on focused editable field).

  5. Does not support the ClipboardEvent constructor

  6. Supports cut & copy events without a focused editable field, but not paste (presumably for security reasons)

  7. Supports cut & copy events without a focused editable field, but does not fire paste with document.execCommand('paste')

Bugs

  • Before Firefox 41, queryCommandEnabled and execCommand with arguments cut, copy or paste would throw errors instead of return false.

Resources

Data by caniuse.com
Licensed under the Creative Commons Attribution License v4.0.
http://caniuse.com/#feat=clipboard

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部