Documentation
¶
Overview ¶
Package extensions provides the Chrome DevTools Protocol commands, types, and events for the Extensions domain.
Defines commands and events for browser extensions.
Generated by the pdlgen command.
Index ¶
- Constants
- type ClearStorageItemsParams
- type ExtensionInfo
- type GetExtensionsParams
- type GetExtensionsReturns
- type GetStorageItemsParams
- type GetStorageItemsReturns
- type LoadUnpackedParams
- type LoadUnpackedReturns
- type RemoveStorageItemsParams
- type SetStorageItemsParams
- type StorageArea
- type TriggerActionParams
- type UninstallParams
Constants ¶
const ( CommandTriggerAction = "Extensions.triggerAction" CommandLoadUnpacked = "Extensions.loadUnpacked" CommandGetExtensions = "Extensions.getExtensions" CommandUninstall = "Extensions.uninstall" CommandGetStorageItems = "Extensions.getStorageItems" CommandRemoveStorageItems = "Extensions.removeStorageItems" CommandClearStorageItems = "Extensions.clearStorageItems" CommandSetStorageItems = "Extensions.setStorageItems" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearStorageItemsParams ¶
type ClearStorageItemsParams struct {
ID string `json:"id"` // ID of extension.
StorageArea StorageArea `json:"storageArea"` // StorageArea to remove data from.
}
ClearStorageItemsParams clears extension storage in the given storageArea.
func ClearStorageItems ¶
func ClearStorageItems(id string, storageArea StorageArea) *ClearStorageItemsParams
ClearStorageItems clears extension storage in the given storageArea.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-clearStorageItems
parameters:
id - ID of extension. storageArea - StorageArea to remove data from.
type ExtensionInfo ¶
type ExtensionInfo struct {
ID string `json:"id"` // Extension id.
Name string `json:"name"` // Extension name.
Version string `json:"version"` // Extension version.
Path string `json:"path"` // The path from which the extension was loaded.
Enabled bool `json:"enabled"` // Extension enabled status.
}
ExtensionInfo detailed information about an extension.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#type-ExtensionInfo
type GetExtensionsParams ¶
type GetExtensionsParams struct{}
GetExtensionsParams gets a list of all unpacked extensions.
func GetExtensions ¶
func GetExtensions() *GetExtensionsParams
GetExtensions gets a list of all unpacked extensions.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-getExtensions
func (*GetExtensionsParams) Do ¶
func (p *GetExtensionsParams) Do(ctx context.Context) (extensions []*ExtensionInfo, err error)
Do executes Extensions.getExtensions against the provided context.
returns:
extensions
type GetExtensionsReturns ¶
type GetExtensionsReturns struct {
Extensions []*ExtensionInfo `json:"extensions,omitempty,omitzero"`
}
GetExtensionsReturns return values.
type GetStorageItemsParams ¶
type GetStorageItemsParams struct {
ID string `json:"id"` // ID of extension.
StorageArea StorageArea `json:"storageArea"` // StorageArea to retrieve data from.
Keys []string `json:"keys,omitempty,omitzero"` // Keys to retrieve.
}
GetStorageItemsParams gets data from extension storage in the given storageArea. If keys is specified, these are used to filter the result.
func GetStorageItems ¶
func GetStorageItems(id string, storageArea StorageArea) *GetStorageItemsParams
GetStorageItems gets data from extension storage in the given storageArea. If keys is specified, these are used to filter the result.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-getStorageItems
parameters:
id - ID of extension. storageArea - StorageArea to retrieve data from.
func (*GetStorageItemsParams) Do ¶
Do executes Extensions.getStorageItems against the provided context.
returns:
data
func (GetStorageItemsParams) WithKeys ¶
func (p GetStorageItemsParams) WithKeys(keys []string) *GetStorageItemsParams
WithKeys keys to retrieve.
type GetStorageItemsReturns ¶
GetStorageItemsReturns return values.
type LoadUnpackedParams ¶
type LoadUnpackedParams struct {
Path string `json:"path"` // Absolute file path.
EnableInIncognito bool `json:"enableInIncognito"` // Enable the extension in incognito
}
LoadUnpackedParams installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed.
func LoadUnpacked ¶
func LoadUnpacked(path string) *LoadUnpackedParams
LoadUnpacked installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-loadUnpacked
parameters:
path - Absolute file path.
func (*LoadUnpackedParams) Do ¶
func (p *LoadUnpackedParams) Do(ctx context.Context) (id string, err error)
Do executes Extensions.loadUnpacked against the provided context.
returns:
id - Extension id.
func (LoadUnpackedParams) WithEnableInIncognito ¶
func (p LoadUnpackedParams) WithEnableInIncognito(enableInIncognito bool) *LoadUnpackedParams
WithEnableInIncognito enable the extension in incognito.
type LoadUnpackedReturns ¶
type LoadUnpackedReturns struct {
ID string `json:"id,omitempty,omitzero"` // Extension id.
}
LoadUnpackedReturns return values.
type RemoveStorageItemsParams ¶
type RemoveStorageItemsParams struct {
ID string `json:"id"` // ID of extension.
StorageArea StorageArea `json:"storageArea"` // StorageArea to remove data from.
Keys []string `json:"keys"` // Keys to remove.
}
RemoveStorageItemsParams removes keys from extension storage in the given storageArea.
func RemoveStorageItems ¶
func RemoveStorageItems(id string, storageArea StorageArea, keys []string) *RemoveStorageItemsParams
RemoveStorageItems removes keys from extension storage in the given storageArea.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-removeStorageItems
parameters:
id - ID of extension. storageArea - StorageArea to remove data from. keys - Keys to remove.
type SetStorageItemsParams ¶
type SetStorageItemsParams struct {
ID string `json:"id"` // ID of extension.
StorageArea StorageArea `json:"storageArea"` // StorageArea to set data in.
Values jsontext.Value `json:"values"`
}
SetStorageItemsParams sets values in extension storage in the given storageArea. The provided values will be merged with existing values in the storage area.
func SetStorageItems ¶
func SetStorageItems(id string, storageArea StorageArea, values jsontext.Value) *SetStorageItemsParams
SetStorageItems sets values in extension storage in the given storageArea. The provided values will be merged with existing values in the storage area.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-setStorageItems
parameters:
id - ID of extension. storageArea - StorageArea to set data in. values - Values to set.
type StorageArea ¶
type StorageArea string
StorageArea storage areas.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#type-StorageArea
const ( StorageAreaSession StorageArea = "session" StorageAreaLocal StorageArea = "local" StorageAreaSync StorageArea = "sync" StorageAreaManaged StorageArea = "managed" )
StorageArea values.
func (StorageArea) String ¶
func (t StorageArea) String() string
String returns the StorageArea as string value.
type TriggerActionParams ¶
type TriggerActionParams struct {
ID string `json:"id"` // Extension id.
TargetID string `json:"targetId"` // A tab target ID to trigger the default extension action on.
}
TriggerActionParams runs an extension default action.
func TriggerAction ¶
func TriggerAction(id string, targetID string) *TriggerActionParams
TriggerAction runs an extension default action.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-triggerAction
parameters:
id - Extension id. targetID - A tab target ID to trigger the default extension action on.
type UninstallParams ¶
type UninstallParams struct {
ID string `json:"id"` // Extension id.
}
UninstallParams uninstalls an unpacked extension (others not supported) from the profile.
func Uninstall ¶
func Uninstall(id string) *UninstallParams
Uninstall uninstalls an unpacked extension (others not supported) from the profile.
See: https://chromedevtools.github.io/devtools-protocol/tot/Extensions#method-uninstall
parameters:
id - Extension id.