Closed idanarye closed 6 years ago
The developer who implemented the protocol is no longer available so for that document to exist, someone has to reverse engineer it. PRs welcome.
Here's how it works in short:
localhost:4001
, inside the editor. 4001 is the default port but should be customizable on both sides.fetch()
towards http://localhost:4001
{"ProtocolVersion":1, "WebSocketPort":12345}
, where 12345 is the editor's new WebSocket server's port.{
title: document.title, // String
url: location.host, // String
syntax: '', // unused for now
text: field.value, // String
selections: [
{
// 0-index positions of selection, integers
start: this.field.selectionStart
end: this.field.selectionEnd
}
]
}
field.value
changes.text
and selection
fields.
Can you add a
PROTOCL.md
for describing the protocol between the Chrome extension and the editor extension/script? Without something like this, people who want to write an extension for their favorite editor have to reverse engineer the chrome extension or one of the plugins...