Index

Type aliases

MessageCommand

MessageCommand: "version" | "run" | "read" | "write" | "temp" | "mkdir" | "eval" | "getconfig" | "env"

Variables

NATIVE_NAME

NATIVE_NAME: "tridactyl" = "tridactyl"

logger

logger: Logger = new Logger("native")

Functions

editor

  • editor(file: string, content?: string): Promise<MessageResp>

ffargs

  • ffargs(): Promise<string[]>
  • This returns the commandline that was used to start firefox. You'll get both firefox binary (not necessarily an absolute path) and flags

    Returns Promise<string[]>

firstinpath

  • firstinpath(cmdarray: any): Promise<any>

getBestEditor

  • getBestEditor(): Promise<string>

getNativeMessengerVersion

  • getNativeMessengerVersion(quiet?: boolean): Promise<number>

getProfileDir

  • getProfileDir(): Promise<string>

getenv

  • getenv(variable: string): Promise<string>

getrc

  • getrc(): Promise<string>

inpath

  • inpath(cmd: any): Promise<boolean>

mkdir

  • mkdir(dir: string, exist_ok: boolean): Promise<MessageResp>

nativegate

  • nativegate(version?: string, interactive?: boolean, desiredOS?: string[]): Promise<Boolean>
  • Used internally to gate off functions that use the native messenger. Gives a helpful error message in the command line if the native messenger is not installed, or is the wrong version.

    arg

    version: A string representing the minimal required version.

    arg

    interactive: True if a message should be displayed on version mismatch.

    Parameters

    • Default value version: string = "0"
    • Default value interactive: boolean = true
    • Default value desiredOS: string[] = ["mac", "win", "linux", "openbsd"]

    Returns Promise<Boolean>

    false if the required version is higher than the currently available native messenger version.

pyeval

  • Evaluates a string in the native messenger. This has to be python code. If you want to run shell strings, use run() instead.

    Parameters

    • command: string

    Returns Promise<MessageResp>

read

run

sendNativeMsg

temp

  • temp(content: string, prefix: string): Promise<MessageResp>

write

  • write(file: string, content: string): Promise<MessageResp>