Documentation
¶
Overview ¶
Chrome browser module.
Chrome bookmarks are stored in a json file normally called Bookmarks. The bookmarks file is updated atomically by chrome for each change to the bookmark entries by the user.
Changes are detected by watching the parent directory for fsnotify.Create events on the bookmark file. On linux this is done by using fsnotify.
Chrome browser module.
Chrome bookmarks are stored in a json file normally called Bookmarks. The bookmarks file is updated atomically by chrome for each change to the bookmark entries by the user.
Changes are detected by watching the parent directory for fsnotify.Create events on the bookmark file. On linux this is done by using fsnotify.
Copyright (c) 2023 Chakib Ben Ziane <contact@blob42.xyz> and [`gosuki` contributors](https://github.com/blob42/gosuki/graphs/contributors). All rights reserved.
SPDX-License-Identifier: AGPL-3.0-or-later
This file is part of GoSuki.
GoSuki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
GoSuki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with gosuki. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- type Chrome
- func (ch Chrome) Config() *modules.BrowserConfig
- func (c *Chrome) GetCurFlavour() *browsers.BrowserDef
- func (c *Chrome) GetProfile() *profiles.Profile
- func (*Chrome) GetProfiles(flavour string) ([]*profiles.Profile, error)
- func (ch *Chrome) Init(ctx *modules.Context, p *profiles.Profile) error
- func (*Chrome) ListFlavours() []browsers.BrowserDef
- func (ch Chrome) ModInfo() modules.ModInfo
- func (ch *Chrome) PreLoad(_ *modules.Context) error
- func (ch *Chrome) ResetWatcher() error
- func (ch *Chrome) Run()
- func (ch *Chrome) Shutdown() error
- func (c *Chrome) UseProfile(p *profiles.Profile, flv *browsers.BrowserDef) error
- func (ch *Chrome) Watch() *watch.WatchDescriptor
- func (chrome *Chrome) WatchAllProfiles() bool
- type ChromeConfig
- type ChromeProfileManager
- type ParseChildJSONFunc
- type RawNode
- type RecursiveParseJSONFunc
- type StateData
Constants ¶
const ( BrowserName = "chrome" // Default flavour to use DefaultProfile = "Default" RootNodeName = "ROOT" )
const StateFile = "Local State"
Chrome state file. The state file is a json file containing the last used profile and the list of profiles. Equivalent to the profiles.ini file for mozilla browsers.
Variables ¶
var ( ProfileManager = &ChromeProfileManager{} ChromeCfg = NewChromeConfig() )
Functions ¶
This section is empty.
Types ¶
type Chrome ¶
type Chrome struct {
// holds browsers.BrowserConfig
*ChromeConfig
parsing.Counter
// contains filtered or unexported fields
}
Chrome browser module
func (Chrome) Config ¶
func (ch Chrome) Config() *modules.BrowserConfig
Returns a pointer to an initialized browser config
func (*Chrome) GetCurFlavour ¶
func (c *Chrome) GetCurFlavour() *browsers.BrowserDef
get current active flavour
func (*Chrome) GetProfile ¶
func (*Chrome) GetProfiles ¶
func (*Chrome) ListFlavours ¶
func (*Chrome) ListFlavours() []browsers.BrowserDef
Returns all flavours supported by this browser
func (*Chrome) ResetWatcher ¶
func (*Chrome) UseProfile ¶
Notifies the module to use a custom profile NOTE: this is implemented at the browser Level
func (*Chrome) Watch ¶
func (ch *Chrome) Watch() *watch.WatchDescriptor
func (*Chrome) WatchAllProfiles ¶
If should watch all profiles
type ChromeConfig ¶
type ChromeConfig struct {
*modules.BrowserConfig `toml:"-"`
modules.ProfilePrefs `toml:"profile-options" mapstructure:"profile-options"`
CustomProfiles []profiles.CustomProfile `toml:"custom-profiles" mapstructure:"custom-profiles"`
}
func NewChromeConfig ¶
func NewChromeConfig() *ChromeConfig
type ChromeProfileManager ¶
type ChromeProfileManager struct{}
Helper struct to manage chrome profiles profiles.ProfileManager is implemented at the browser level
func (*ChromeProfileManager) GetProfileByID ¶
func (cpm *ChromeProfileManager) GetProfileByID(flavour string, id string) (*profiles.Profile, error)
chrome uses ID to identify the profile path
func (*ChromeProfileManager) GetProfiles ¶
func (*ChromeProfileManager) GetProfiles(flavour string) ([]*profiles.Profile, error)
Returns all profiles for a given flavour
type ParseChildJSONFunc ¶
type ParseChildJSONFunc func([]byte, jsonparser.ValueType, int, error)
Type of the func used recursively on each json node entry by jsonparser.ArrayEach
type RawNode ¶
type RawNode struct {
// contains filtered or unexported fields
}
type used to store json nodes in memory for parsing.