浏览器环境下,JavaScript 读写剪切板
读取剪切板
var p = navigator.clipboard.readText();
p.then(function(clipText){
console.log(clipText); // 剪贴板内容
});
写入剪切板
var clipboard = navigator.clipboard;
var p = clipboard.writeText(text);
p.then(function (d){
//do
});
标签:function,读写,JavaScript,clipboard,剪切板,var
From: https://www.cnblogs.com/cqpanda/p/16925817.html