{"author_url":"https://blog.hatena.ne.jp/ledsun/","author_name":"ledsun","type":"rich","categories":["JavaScript","\u6280","Clipboard","Web"],"height":"190","image_url":null,"version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fledsun.hatenablog.com%2Fentry%2F2021%2F12%2F07%2F224116\" title=\"Clipboard Events API\u3067\u306fpreventDefault\u3092\u547c\u3076\u5fc5\u8981\u304c\u3042\u308b - @ledsun blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","url":"https://ledsun.hatenablog.com/entry/2021/12/07/224116","published":"2021-12-07 22:41:16","title":"Clipboard Events API\u3067\u306fpreventDefault\u3092\u547c\u3076\u5fc5\u8981\u304c\u3042\u308b","blog_url":"https://ledsun.hatenablog.com/","blog_title":"@ledsun blog","width":"100%","description":"https://w3c.github.io/clipboard-apis/#override-copy To override the default copy event behavior, a copy event handler must be added and this event handler must call preventDefault() to cancel the event. window.addEventListener('copy', (e) => { e.clipboardData.setData('text/plain', 'ABC'); e.preventD\u2026","provider_name":"Hatena Blog"}