1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15

content / test / data / paste_listener.html [blame]

<title>Waiting for paste</title>
<body>
<script>
document.body.contentEditable = true;
document.body.addEventListener('paste', (event) => {
  Array.prototype.forEach.call(event.clipboardData.items, (item) => {
    if (item.type != 'text/rtf') {
      return;
    }
    item.getAsString((s) => {
      document.title = s;
    });
  });
});
</script>