gpt4 book ai didi

Javascript:如何使用复制/粘贴选项制作自定义上下文菜单

转载 作者:行者123 更新时间:2023-11-29 23:55:21 24 4
gpt4 key购买 nike

我们正在为我们的在线文本编辑器制作自定义上下文菜单。里面有复制/粘贴选项是很自然的。但是我们发现很难从浏览器中访问系统剪贴板。几年前这似乎是不可能的:Custom Context Menu with Javascript?

尽管如此,谷歌在没有 flash 或特殊插件帮助的情况下设法在谷歌文档中做到了这一点,据我所知,它在 chrome 和 Firefox 中都能正常工作。我想知道他们用什么来实现这一目标?

enter image description here

最佳答案

经过更多研究,我认为该功能在 Chrome 中有效,但在 firefox 中无效(我的问题中的错误)。将出现一个弹出窗口,指示用户改用快捷方式: A Dialog showing incompatibility with browsers suggesting key shortcuts be used as a workaround, for a mac

所以 Google 似乎使用 Google Docs Offline 扩展来提供此功能。如果扩展被禁用,它会提示您安装 Google Drive 应用程序。

很遗憾,没有通用的解决方案。

下面的对话是几年前的事了,但仍然是事实:

How to paste on click? It works in google docs

javascript cut/copy/paste to clipboard: how did Google solve it?

Adding copy & paste functionalities to a custom menu of a webapp

关于Javascript:如何使用复制/粘贴选项制作自定义上下文菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41824829/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com