Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should check options.format for other browser #99

Open
qrqhuang opened this issue Aug 3, 2020 · 1 comment
Open

Should check options.format for other browser #99

qrqhuang opened this issue Aug 3, 2020 · 1 comment

Comments

@qrqhuang
Copy link

qrqhuang commented Aug 3, 2020

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);
}
@qrqhuang
Copy link
Author

qrqhuang commented Aug 3, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant