دنبال کننده ها

۱۳۹۶ دی ۱۱, دوشنبه

javascript - How to feature detect W3C Clipboard API support in browsers?

[ad_1]



The W3C Clipboard API support is limited in browsers: https://caniuse.com/#feat=clipboard



  • Internet Explorer uses its own legacy solution

  • Edge only supports writing and reading data with MIME type text/plain

For my purpose I would need to know if the following code would set data to the clipboard, or not (where ev is the clipboard event handler's event information object):



ev.dataTransfer.setData("text/html", "<b>some html</b>");


Since the object ev is only available after user interaction, the question is: Is there any other way to feature detect this without user interaction?




[ad_2]

لینک منبع