We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async function getClipboardContents() { try { const clipboardItems = await navigator.clipboard.read(); for (const clipboardItem of clipboardItems) { for (const type of clipboardItem.types) { const blob = await clipboardItem.getType(type); if (blob.type.startsWith('image/')) { // 处理图片 const imageUrl = URL.createObjectURL(blob); console.log('图片 URL:', imageUrl); } else if (blob.type.startsWith('text/')) { // 处理文本 const text = await blob.text(); console.log('文本内容:', text); } else { // 处理其他类型数据 console.log('其他类型数据:', blob.type, blob); } } } } catch (err) { console.error('读取剪贴板内容时出错:', err); } }
可以很好的获取 来自word等内容,以便于做富文本解析等
The text was updated successfully, but these errors were encountered:
注意 :
Sorry, something went wrong.
No branches or pull requests
可以很好的获取 来自word等内容,以便于做富文本解析等
The text was updated successfully, but these errors were encountered: