cloud

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package cloud provides access to Safari's iCloud Tabs.

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultTabsPath is the path to the default CloudTabs database.
	DefaultTabsPath = filefinder.New([]string{
		filepath.Join(os.Getenv("HOME"), "Library/Safari/CloudTabs.db"),
		filepath.Join(os.Getenv("HOME"), "Library/Containers/com.apple.Safari/Data/Library/Safari/CloudTabs.db"),
	}).FirstExists()
)

Functions

This section is empty.

Types

type ByDeviceIndex added in v0.4.0

type ByDeviceIndex []*Tab

ByDeviceIndex sorts Tabs by device name and sort index.

func (ByDeviceIndex) Len added in v0.4.0

func (t ByDeviceIndex) Len() int

Implement sort.Interface

func (ByDeviceIndex) Less added in v0.4.0

func (t ByDeviceIndex) Less(i, j int) bool

func (ByDeviceIndex) Swap added in v0.4.0

func (t ByDeviceIndex) Swap(i, j int)

type CloudTabs

type CloudTabs struct {
	DB *sql.DB
}

CloudTabs is a collection of Tabs.

func New

func New(filename string) (*CloudTabs, error)

New creates a new Tabs from a Safari CloudTabs.db database.

func (*CloudTabs) Tabs

func (c *CloudTabs) Tabs() ([]*Tab, error)

Tabs returns all Cloud Tabs. Tabs for the current device are ignored.

type Tab

type Tab struct {
	Title     string // Tab title
	URL       string // URL
	Device    string // Computer/phone/tablet name
	SortIndex int    // sortValue from position blob
}

Tab is a cloud tab.

func Tabs

func Tabs() ([]*Tab, error)

Tabs returns all Cloud Tabs. Tabs for the current device are ignored.

Jump to

Keyboard shortcuts

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