browserbridge

package
v0.13.9 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package browserbridge contains Redeven's local Chrome Native Messaging wire. It carries closed product commands; it never authorizes or evaluates scripts.

Index

Constants

View Source
const ExtensionID = "mgfbpkkmocckooenpdfpefknffjanjce"

ExtensionID binds native messaging to the packaged Flower extension key.

View Source
const MaxMessageBytes = 24 << 20
View Source
const ProtocolVersion = 9

Variables

This section is empty.

Functions

func Forward

func Forward(ctx context.Context, socket, origin string, input io.Reader, output io.Writer) error

Forward is a local byte relay. Chrome starts it from a manifest whose sole allowed origin is the packaged extension. No HTTP port or remote routing is involved; the Runtime owns the private Unix socket and every target grant.

func ReadMessage

func ReadMessage(reader io.Reader, limit uint32) (json.RawMessage, error)

func RemoteProfileID

func RemoteProfileID(state, owner, installationID string) string

func WriteMessage

func WriteMessage(writer io.Writer, value any, limit uint32) error

Types

type Diagnostic

type Diagnostic struct {
	Stage        string `json:"stage"`
	Reason       string `json:"reason"`
	DiagnosticID string `json:"diagnostic_id,omitempty"`
}

Diagnostic exposes stable recovery facts without platform error output.

type Installation

type Installation struct {
	ID                string      `json:"id"`
	Kind              string      `json:"kind"`
	Name              string      `json:"name"`
	Installed         bool        `json:"installed"`
	Prepared          bool        `json:"prepared"`
	Connected         bool        `json:"connected"`
	Reason            string      `json:"reason,omitempty"`
	Diagnostic        *Diagnostic `json:"diagnostic,omitempty"`
	Executable        string      `json:"-"`
	ManifestDirectory string      `json:"-"`
	PrivateRoot       string      `json:"-"`
}

Installation is a host-discovered browser, never a caller-selected path. Platform differences stop at launch and Native Messaging file placement.

func Installations

func Installations() ([]Installation, error)

func ResolveInstallation

func ResolveInstallation(id string) (Installation, error)

type RemoteProfile

type RemoteProfile struct {
	ID        string
	Directory string
	Arguments []string
}

RemoteProfile describes product-owned browser data for a private graphical application. The host-application service remains its sole process/display owner. These paths and arguments are never accepted from a browser client.

func PrepareRemoteProfile

func PrepareRemoteProfile(state, owner string, installation Installation, nativeHost string) (RemoteProfile, error)

PrepareRemoteProfile never reads a personal profile. Only the existing Runtime registration is installed into this separate browser's data root. Repeated preparation preserves cookies, site storage and extension consent.

Jump to

Keyboard shortcuts

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