1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[rails]「クリップボードへのコピー」の実装方法の選定

1
Last updated at Posted at 2026-03-31

クリップボードコピーの実装方法の選定

document.execCommand('copy')navigator.clipboard.writeText()、そしてclipboard.jsの3つを検討した。

document.execCommand('copy') を選ばなかった理由

MDNは document.execCommand('copy') をDeprecated(廃止予定)と位置づけており、動作の保証がなくなっているため。(参照:https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand)

clipboard.js を選ばなかった理由

参照した情報源

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?