webextension-protocol 0.1.0

Webextension native messaging protocol helpers
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 6 items with examples
  • Size
  • Source code size: 39.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.15 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • chrmod

Webextension native messaging protocol helpers for Rust

This repository is a set of helper functions for working with Native Messaging protocol, which is a way for webextension to exchange messages with native applications.

Read more about native messaging here:

Example usage

Simple echo application:

#[macro_use(println_stderr)]
extern crate webextension_rust_template as protocol;
use std::io::Write;
use std::process;

fn main() {
    loop {
        let message = match protocol::read_stdin() {
            Ok(m) => m,
            Err(_) => process::exit(1),
        };
        println_stderr!("received {}", message);
        protocol::write_stdout(message);
    }
}