获取当前剪贴板内容? [英] Get current clipboard content?

查看:162
本文介绍了获取当前剪贴板内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道一种方法,让我的脚本检测剪贴板的内容,并在打开页面时将其粘贴到文本字段中,而无需用户输入。如何做?

I'd like to know a way to make my script detect the content of the clipboard and paste it into a text field when the page is opened, with no input from the user. How can it be done?

推荐答案

window.clipboardData.getData('Text')可以在某些浏览器中使用。但是,它运行的许多浏览器会提示用户是否希望网页能够访问剪贴板。

window.clipboardData.getData('Text') will work in some browsers. However, many browsers where it does work will prompt the user as to whether or not they wish the web page to have access to the clipboard.

这篇关于获取当前剪贴板内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆