browser

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package browser Created by Teocci. Author: teocci@yandex.com on 2021-Aug-12

Package browser Created by Teocci. Author: teocci@yandex.com on 2021-Aug-12

Package browser Created by Teocci. Author: teocci@yandex.com on 2021-Aug-12

Package browser Created by Teocci. Author: teocci@yandex.com on 2021-Aug-15

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItemPath added in v1.0.1

func GetItemPath(profilePath, file string) (string, error)

GetItemPath try to get item file path with the browser's profile path default key file path is in the parent directory of the profile dir, and name is [Local State]

func InitSecretKey added in v1.0.1

func InitSecretKey(c *Chromium) error

Types

type Browser

type Browser interface {
	// InitSecretKey is init chrome secret key, firefox's key always empty
	InitSecretKey() error

	// GetName return browser name
	GetName() string

	// GetSecretKey return browser secret key
	GetSecretKey() []byte

	// GetAllItems return all items (password|bookmark|cookie|history)
	GetAllItems() ([]data.Item, error)

	// GetItem return single one from the password|bookmark|cookie|history
	GetItem(itemName string) (data.Item, error)

	// ListItems return list of items
	ListItems() []string
}

func NewChromium

func NewChromium(profile, key, name, storage string) (Browser, error)

NewChromium return Chromium browser interface

func NewFirefox

func NewFirefox(profile, key, name, storage string) (Browser, error)

NewFirefox return firefox browser interface

func PickBrowser

func PickBrowser(name string) ([]Browser, error)

PickBrowser return a list of browser interface

func PickCustomBrowser

func PickCustomBrowser(browserName, cusProfile, cusKey string) ([]Browser, error)

PickCustomBrowser pick single browser with custom browser profile path and key file path (Windows only). If custom key file path is empty, but the current browser requires key file (chromium for Windows version > 80) key file path will be automatically found in the profile path's parent directory.

type Chromium

type Chromium struct {
	// contains filtered or unexported fields
}

func (*Chromium) GetAllItems

func (c *Chromium) GetAllItems() ([]data.Item, error)

GetAllItems return all chromium items from browser If it can't find the item path, log error then continue

func (*Chromium) GetItem

func (c *Chromium) GetItem(itemName string) (data.Item, error)

GetItem return single item

func (*Chromium) GetKeyPath added in v1.0.1

func (c *Chromium) GetKeyPath() string

func (*Chromium) GetName

func (c *Chromium) GetName() string

func (*Chromium) GetSecretKey

func (c *Chromium) GetSecretKey() []byte

func (*Chromium) GetStorage added in v1.0.1

func (c *Chromium) GetStorage() string

func (*Chromium) InitSecretKey

func (c *Chromium) InitSecretKey() error

func (*Chromium) ListItems added in v1.0.1

func (c *Chromium) ListItems() []string

func (*Chromium) SetSecretKey added in v1.0.1

func (c *Chromium) SetSecretKey(secretKey []byte)

type Firefox

type Firefox struct {
	// contains filtered or unexported fields
}

func (*Firefox) GetAllItems

func (f *Firefox) GetAllItems() ([]data.Item, error)

GetAllItems return all item with firefox

func (*Firefox) GetItem

func (f *Firefox) GetItem(itemName string) (data.Item, error)

func (*Firefox) GetName

func (f *Firefox) GetName() string

func (*Firefox) GetSecretKey

func (f *Firefox) GetSecretKey() []byte

GetSecretKey for firefox is always nil this method used to implement Browser interface

func (*Firefox) InitSecretKey

func (f *Firefox) InitSecretKey() error

InitSecretKey for firefox is always nil this method used to implement Browser interface

func (*Firefox) ListItems added in v1.0.1

func (f *Firefox) ListItems() []string

Jump to

Keyboard shortcuts

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