简体   繁体   English

通过Chrome的开发工具编辑资源时,是否有办法监视keyup事件?

[英]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.

相关问题 有没有办法通过 Python 加载网页的网络活动(您可以在 Chrome Dev Tools 上看到)? - Is there a way to get a webpage's Network activity (which you can see on Chrome Dev Tools) on load via Python? 在Chrome的Ominbox上按下Enter键时,键盘事件监听器将触发 - Keyup event listener fires when enter is pressed on Chrome's Ominbox 带有导入模块的Chrome开发工具中看不到监视表达式 - Can't see watch expression in Chrome dev tools with import module Chrome 开发工具不显示通过扩展内容脚本添加的事件侦听器 - Chrome dev tools doesn't show the event listener added via extension content script Chrome 开发工具中的不同数组 - Different Array(s) in Chrome Dev Tools 调试JS时,Chrome开发工具崩溃了 - Chrome dev tools crashing when debugging JS 当js文件的链接以调试器开头时,在Chrome开发工具中是什么意思? - What does it mean in Chrome's dev tools when a js file's link starts with debugger? Chrome开发工具 - 将网络资源映射到本地文件不起作用 - Chrome Dev Tools - Mapping network resource to local file not working 我可以使用Chrome开发工具添加资源吗? - Can I add a resource using Chrome Dev Tools? Chrome 开发工具:如何查看 HTML 元素的附加事件侦听器 - Chrome dev tools: How to see attached event listeners for an HTML element
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM