剪贴板访问使用JavaScript - 无闪存? [英] Clipboard access using Javascript - sans Flash?

查看:148
本文介绍了剪贴板访问使用JavaScript - 无闪存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种可靠的方式来访问客户端机器的剪贴板使用Javascript?尝试执行此操作时,我仍然遇到权限问题。 Google文档如何做到这一点?他们是否使用Flash?



我的主要目标是IE8,但是也想支持FF和Chrome。

我已经看到了使用Flash来做这个的技巧,但是我正在寻找一个纯粹的js路由:

由于这是一个很大的安全所有关心安全性的浏览器都不允许JS访问剪贴板。



主要的原因是很多人把他们的密码放到一个文本文件中,然后使用剪切并粘贴登录。然后,破解者可以从剪贴板上收集密码(可能还有其他私人信息,比如刚刚复制的文档),方法是破解一个流行网站,并安装一些JS,然后将剪贴板的内容发送给他们。

这就是为什么我一直禁用闪光灯。


Is there a reliable way to access the client machine's clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use Flash?

My primary target is IE8, but would like to support FF and Chrome also.

I have seen the technique to do this using Flash, but am looking for a pure js route:
Clipboard access using Flash

解决方案

Since this is a big security risk, all browsers that care about safety don't allow JS to access the clipboard.

The main reason is that many people put their passwords into a text file and then use cut&paste to login. Crackers could then collect the password (and possibly other private information like the word document which you just copied) from the clipboard by cracking a popular site and installing some JS that sends them the content of the clipboard.

Which is why I have flash disabled all the time.

这篇关于剪贴板访问使用JavaScript - 无闪存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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