FWIW This also fails when running in the sample cefclient application.
- Code: Select all
<body>
<button onclick="javascript:copyToClipboard()">Copy</button>
<div id="result"></div>
</body>
<script language = "javascript">
function copyToClipboard() {
navigator.clipboard.writeText("Hello World").then(function() {
document.getElementById("result").textContent="OK";
}, function(err) {
document.getElementById("result").textContent="Failed";
});
}
</script>