copy-to-clipboard
copy-to-clipboard copied to clipboard
Should check options.format for other browser
for this code fragment, Is it necessary for other browser to check options.format ?
I config wrong with format: 'plain' , and then nothing could paste.
if (typeof e.clipboardData === "undefined") { // IE 11
debug && console.warn("unable to use e.clipboardData");
debug && console.warn("trying IE specific stuff");
window.clipboardData.clearData();
var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]
window.clipboardData.setData(format, text);
} else { // all other browsers
e.clipboardData.clearData();
e.clipboardData.setData(options.format, text);
}
Which more strange thing is when I import js from wzrd.in , code above runs well.
Cause stuck of cdn site , I could not compare source with them.