使用扩展程序访问Chrome剪贴板事件 [英] Access Chrome clipboard events with extension

查看:81
本文介绍了使用扩展程序访问Chrome剪贴板事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在扩展程序中复制系统剪贴板数据;我能够获取复制,剪切和粘贴扩展名的事件,bt我想在系统剪贴板发生更改时获取该事件.

I want to copy the system clipboard data in my extension; I am able to get the events for copy, cut and paste of my extension, bt I want to get the event when ever system clipboard changes.

我该怎么做?

推荐答案

通常,您不能.没有事件表明剪贴板中的系统已更新.

In general, you cannot. There is no event that indicates that SOMEWHERE in the system the clipboard was updated.

一个不完美的解决方案是将内容脚本注入所有页面并监听其中的事件.这仅适用于页面内容本身的复制/剪切.

An imperfect solution would be to inject content scripts in all pages and listen to events in them. This will only work for copy/cut of the content of the pages themselves.

这篇关于使用扩展程序访问Chrome剪贴板事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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