Documentation
¶
Overview ¶
Package crb manipulates Chrome bookmarks.
Written against Chromium aabc28688acc0ba19b42ac3795febddc11a43ede (Chrome 106, 2022-08-22). Should work at least as far back as 2014 (Chrome 40).
See:
Index ¶
- Variables
- func Carve(f io.ReaderAt, fn CarveMatchFunc) error
- func Encode(w io.Writer, b *Bookmarks) error
- func Export(w io.Writer, b *Bookmarks, f FaviconFunc) error
- type BookmarkNode
- type Bookmarks
- type Bytes
- type CarveMatchFunc
- type FaviconFunc
- type GUID
- type NodeType
- type Source
- type Time
- type Version
- type WalkFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBreak = errors.New("break")
Functions ¶
func Carve ¶
func Carve(f io.ReaderAt, fn CarveMatchFunc) error
Carve attempts to recover valid Chrome bookmarks from r, which could be a disk image or something similar. It stops if ErrBreak or another error is returned.
Types ¶
type BookmarkNode ¶
type BookmarkNode struct {
Children *[]BookmarkNode `json:"children,omitempty"` // Type == NodeTypeFolder
DateAdded Time `json:"date_added"`
DateLastUsed Time `json:"date_last_used,omitempty"`
DateModified Time `json:"date_modified,omitempty"`
GUID GUID `json:"guid"`
ID int `json:"id,string"`
Name string `json:"name"`
ShowIcon bool `json:"show_icon,omitempty"` // used by MSEdge
Source Source `json:"source,omitempty"` // used by MSEdge
Type NodeType `json:"type"`
URL string `json:"url,omitempty"`
MetaInfo map[string]string `json:"meta_info,omitempty"`
UnsyncedMetaInfo map[string]string `json:"unsynced_meta_info,omitempty"`
}
func (BookmarkNode) Walk ¶
func (n BookmarkNode) Walk(fn WalkFunc) error
Walk iterates over folders and bookmarks in b depth-first, stopping if ErrBreak or another error is returned.
type Bookmarks ¶
type Bookmarks struct {
Checksum string `json:"checksum"`
Roots struct {
BookmarkBar BookmarkNode `json:"bookmark_bar"`
Other BookmarkNode `json:"other"`
MobileBookmark BookmarkNode `json:"synced"`
} `json:"roots"`
SyncMetadata Bytes `json:"sync_metadata,omitempty"`
Version Version `json:"version"`
MetaInfo map[string]string `json:"meta_info,omitempty"`
UnsyncedMetaInfo map[string]string `json:"unsynced_meta_info,omitempty"`
}
func (Bookmarks) CalculateChecksum ¶
Calculate calculates the expected checksum for b.
type FaviconFunc ¶
FaviconFunc gets the data URL of the favicon for url, returning an empty string if one isn't available.
type Version ¶
type Version int
const CurrentVersion Version = 1
func (Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
type WalkFunc ¶
type WalkFunc func(n BookmarkNode, parents ...string) error
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
crb
command
Command crb parses, validates, and exports Chrome bookmark files.
|
Command crb parses, validates, and exports Chrome bookmark files. |
|
crb-carve
command
Command crb-carve attempts to recover Chrome bookmark files from a file.
|
Command crb-carve attempts to recover Chrome bookmark files from a file. |
Click to show internal directories.
Click to hide internal directories.