chromemsg

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package chromemsg implements the Chrome native messaging protocol: https://developer.chrome.com/docs/extensions/develop/concepts/native-messaging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureHost

func ConfigureHost() error

Configure writes native messaging host configuration to various well-known folders, including Google Chrome, Arc, Microsoft Edge, and Vivaldi.

See: https://developer.chrome.com/docs/extensions/develop/concepts/native-messaging#native-messaging-host

The resulting file looks like this:

  {
	 "name": "io.commonfate.granted",
	 "description": "Granted BrowserSupport",
	 "path": "/usr/local/bin/granted",
	 "type": "stdio",
	 "allowed_origins": [
	   "chrome-extension://fcipjekpmlpmiikgdecbjbcpmenmceoh/"
	 ]
  }

Types

type HostManifest

type HostManifest struct {
	Name           string   `json:"name"`
	Description    string   `json:"description"`
	Path           string   `json:"path"`
	Type           string   `json:"type"`
	AllowedOrigins []string `json:"allowed_origins"`
}

type Server

type Server struct {
	Input  io.Reader
	Output io.Writer
}

func (*Server) Read

func (s *Server) Read(p []byte) (int, error)

func (*Server) Write

func (s *Server) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL