JavaScript 粘贴和多个剪贴板级别

发布于 2024-10-02 05:52:07 字数 383 浏览 0 评论 0原文

在网上搜索并尝试在 Opera 浏览器上使用 javascript 进行粘贴的一些不成功的经验之后,我想问:

1)有没有一种方法可以在 javascript 中进行粘贴,同时适用于 Opera 和 Firefox/Mozilla?

2)如果我能达到更多级别的剪贴板,那将非常有用。我解释一下:我使用另一个应用程序复制“第一个文本”和“第二个文本”之后。当我切换到浏览器时,通过某种机制(参数、变量等),我可以访问最后粘贴的文本、最后粘贴之前的文本等。我还想访问任何剪贴板级别的文本,而无需将其粘贴到某处。
我不知道这些功能是否可行,对于一个不太了解 javascript 世界的人来说,它们似乎可能在某种程度上受到操作系统/桌面环境甚至 javascript/DOM 功能的限制。

提前致谢。

After searching the Internet and doing some unsuccessful experiences trying to do paste using javascript on the Opera browser, I want to ask:

1) Is there a way I can do paste in javascript that works both on Opera and Firefox/Mozilla?

2) It would be very useful if I could reach more levels of clipboard. I explain: I use another application to copy "First text" and after "Second text". When I switch, to the browser, through some mechanism (a parameter, a variable, etc.) I could get access to the last-pasted-text, the before-the-last-pasted-text and so on. I would also like to reach the text of any clipboard level without the obligation of pasting it somewhere.
I don't know if those functionalities are possible and, for a person that is not very much into the javascript world, it seems they may be constrained to some extent by the operating system / desktop environment or even by javascript/DOM capabilities.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沫尐诺 2024-10-09 05:52:08

对于你的第一个问题,你必须使用Flash,我不相信你可以单独使用Javascript来为所有浏览器做到这一点。允许访问用户剪贴板存在一点安全漏洞。

该项目使用 Flash 和 Javascript 来实现:

http://code.google.com/p/zeroclipboard/< /a>

对于第二个,我认为这是不可能的。某些操作系统(或其窗口管理器)支持多级复制和粘贴。我记得 Ubuntu 上的 Gnome 可以,但 Windows 上不行。

For your first question, you have to use Flash, I don't believe you can do it with Javascript alone for all browsers. It's a little bit of a security flaw to allow access to the users clipboard.

This project does it with Flash and Javascript:

http://code.google.com/p/zeroclipboard/

For the second, I don't think this is possible. Some operating systems (or their window managers) support multiple levels of copy and paste. I seem to remember that Gnome on Ubuntu does, but not Windows.

自由如风 2024-10-09 05:52:08

Zeroclipboard 在 code.google.com 中不可用,

您可以从 ZeroClipBoard 网站。

Zeroclipboard is not available in code.google.com

You can access the same from ZeroClipBoard website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文