[英]Is there a way to watch for the keyup event when editing a resource via Chrome's dev tools?
I'm creating a Chrome extension that allows people to edit the same resource at the same time via Chrome's inspector. 我正在创建一个Chrome扩展程序,该程序允许人们通过Chrome的检查器同时编辑相同的资源。 Right now things are only synchronized upon saving via
chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener
but it would be nice to replicate each other's actions in real-time. 目前,只有在通过
chrome.devtools.inspectedWindow.onResourceContentCommitted.addListener
保存后,事情才会同步,但是实时复制彼此的动作会很好。
And since it's related, I should probably also ask if it's even possible to programmatically update the resource (as shown within Chrome's dev tools) so that changes can be reflected. 而且,由于它是相关的,我可能还应该问,是否有可能以编程方式更新资源(如Chrome开发工具中所示),以便可以反映出更改。 I suppose I could force a redownload of the resource, but diffing and applying patches would be much more efficient.
我想我可以强制重新下载资源,但是散布和应用补丁程序会更有效率。
I dont believe there's an API for realtime changes, no. 我不相信有用于实时更改的API,不。
You can use resource.setContent
for updating things. 您可以使用
resource.setContent
进行更新。 Take a look at the fb-flo project or Emmet LiveStyle alpha for implementation. 看一下fb-flo项目或Emmet LiveStyle alpha的实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.