README
¶
crb
Library and tools for parsing and exporting Chrome bookmarks.
Written against Chromium main@{2022-08-28} (Chrome 106). Should work at least as far back as 2014 (Chrome 40).
Usage: crb [options] bookmarks_file
Options:
-E, --export stringArray export bookmarks HTML to the specified file (- for stdout)
-h, --help show this help text
-q, --quiet don't write info about the bookmarks file to stderr
-t, --tree write the bookmarks tree to stdout (use --verbose to show dates)
-v, --verbose show additional information
Usage: crb-carve [options] file[:[start_offset][:[end_offset]|+length]]...
Options:
-h, --help show this help text
-j, --json show information about the recovered files as JSON
-o, --output string write the recovered files to the specified directory
-O, --output-format string output file format (default "bookmarks.{input.basename}-{match.offset}.{bookmarks.checksum}.json")
-q, --quiet don't show information about the recovered files
Output Fields (--output-format, --json):
input.path input file path
input.basename input file basename
match.offset match offset
match.length match length
bookmarks.barguid chrome bookmarks bar folder guid
bookmarks.checksum chrome bookmarks checksum
bookmarks.date.unix most recent date (unix timestamp)
bookmarks.date.unixmicro most recent date (unix microscond timestamp)
bookmarks.date.yyyymmdd most recent data (yyyymmdd)
bookmarks.count.folders number of folders
bookmarks.count.urls number of bookmarks
output output file basename (not for --output-format)
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 ¶
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 crb parses, validates, and exports Chrome bookmark files.
|
Command crb parses, validates, and exports Chrome bookmark files. |
crb-carve
Command crb-carve attempts to recover Chrome bookmark files from a file.
|
Command crb-carve attempts to recover Chrome bookmark files from a file. |