简体   繁体   中英

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. 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.

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. 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.

You can use resource.setContent for updating things. Take a look at the fb-flo project or Emmet LiveStyle alpha for implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM