I have this function, works perfectly in unix based OS (Linux, MacOS), but somehow, does not works in Windows, it just simply does not add anything to the clipboard.
This is running in a NextJS App.
export const copyRichContent = async rich => {
const html = new Blob([rich], { type: 'text/html' })
const data = new ClipboardItem({ 'text/html': html })
await navigator.clipboard
.write([data])
.then(e => console.log('All good', e))
.catch(err => {
console.error(err)
})
}
I expect to be working in Windows machines, no matter the browser.
I was not pasting the copied data into a RCE (What a moron, right?).