Documentation
¶
Overview ¶
Package pwa implements the PWA domain. This domain allows interacting with the browser to control PWAs.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type ChangeAppUserSettingsArgs
- type DisplayMode
- type FileHandler
- type FileHandlerAccept
- type GetOSAppStateArgs
- type GetOSAppStateReply
- type InstallArgs
- type LaunchArgs
- type LaunchFilesInAppArgs
- type LaunchFilesInAppReply
- type LaunchReply
- type OpenCurrentPageInAppArgs
- type UninstallArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeAppUserSettingsArgs ¶
type ChangeAppUserSettingsArgs struct {
ManifestID string `json:"manifestId"` // No description.
LinkCapturing *bool `json:"linkCapturing,omitempty"` // If user allows the links clicked on by the user in the app's scope, or extended scope if the manifest has scope extensions and the flags `DesktopPWAsLinkCapturingWithScopeExtensions` and `WebAppEnableScopeExtensions` are enabled. Note, the API does not support resetting the linkCapturing to the initial value, uninstalling and installing the web app again will reset it. TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet.
DisplayMode DisplayMode `json:"displayMode,omitempty"` // No description.
}
ChangeAppUserSettingsArgs represents the arguments for ChangeAppUserSettings in the PWA domain.
func NewChangeAppUserSettingsArgs ¶
func NewChangeAppUserSettingsArgs(manifestID string) *ChangeAppUserSettingsArgs
NewChangeAppUserSettingsArgs initializes ChangeAppUserSettingsArgs with the required arguments.
func (*ChangeAppUserSettingsArgs) SetDisplayMode ¶
func (a *ChangeAppUserSettingsArgs) SetDisplayMode(displayMode DisplayMode) *ChangeAppUserSettingsArgs
SetDisplayMode sets the DisplayMode optional argument.
func (*ChangeAppUserSettingsArgs) SetLinkCapturing ¶
func (a *ChangeAppUserSettingsArgs) SetLinkCapturing(linkCapturing bool) *ChangeAppUserSettingsArgs
SetLinkCapturing sets the LinkCapturing optional argument. If user allows the links clicked on by the user in the app's scope, or extended scope if the manifest has scope extensions and the flags `DesktopPWAsLinkCapturingWithScopeExtensions` and `WebAppEnableScopeExtensions` are enabled.
Note, the API does not support resetting the linkCapturing to the initial value, uninstalling and installing the web app again will reset it.
TODO(crbug.com/339453269): Setting this value on ChromeOS is not supported yet.
type DisplayMode ¶
type DisplayMode string
DisplayMode If user prefers opening the app in browser or an app window.
const ( DisplayModeNotSet DisplayMode = "" DisplayModeStandalone DisplayMode = "standalone" DisplayModeBrowser DisplayMode = "browser" )
DisplayMode as enums.
func (DisplayMode) String ¶
func (e DisplayMode) String() string
func (DisplayMode) Valid ¶
func (e DisplayMode) Valid() bool
type FileHandler ¶
type FileHandler struct {
Action string `json:"action"` // No description.
Accepts []FileHandlerAccept `json:"accepts"` // No description.
DisplayName string `json:"displayName"` // No description.
}
FileHandler
type FileHandlerAccept ¶
type FileHandlerAccept struct {
MediaType string `json:"mediaType"` // New name of the mimetype according to https://www.iana.org/assignments/media-types/media-types.xhtml
FileExtensions []string `json:"fileExtensions"` // No description.
}
FileHandlerAccept The following types are the replica of https://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67
type GetOSAppStateArgs ¶
type GetOSAppStateArgs struct {
ManifestID string `json:"manifestId"` // The id from the webapp's manifest file, commonly it's the url of the site installing the webapp. See https://web.dev/learn/pwa/web-app-manifest.
}
GetOSAppStateArgs represents the arguments for GetOSAppState in the PWA domain.
func NewGetOSAppStateArgs ¶
func NewGetOSAppStateArgs(manifestID string) *GetOSAppStateArgs
NewGetOSAppStateArgs initializes GetOSAppStateArgs with the required arguments.
type GetOSAppStateReply ¶
type GetOSAppStateReply struct {
BadgeCount int `json:"badgeCount"` // No description.
FileHandlers []FileHandler `json:"fileHandlers"` // No description.
}
GetOSAppStateReply represents the return values for GetOSAppState in the PWA domain.
type InstallArgs ¶
type InstallArgs struct {
ManifestID string `json:"manifestId"` // No description.
InstallURLOrBundleURL *string `json:"installUrlOrBundleUrl,omitempty"` // The location of the app or bundle overriding the one derived from the manifestId.
}
InstallArgs represents the arguments for Install in the PWA domain.
func NewInstallArgs ¶
func NewInstallArgs(manifestID string) *InstallArgs
NewInstallArgs initializes InstallArgs with the required arguments.
func (*InstallArgs) SetInstallURLOrBundleURL ¶
func (a *InstallArgs) SetInstallURLOrBundleURL(installURLOrBundleURL string) *InstallArgs
SetInstallURLOrBundleURL sets the InstallURLOrBundleURL optional argument. The location of the app or bundle overriding the one derived from the manifestId.
type LaunchArgs ¶
type LaunchArgs struct {
ManifestID string `json:"manifestId"` // No description.
URL *string `json:"url,omitempty"` // No description.
}
LaunchArgs represents the arguments for Launch in the PWA domain.
func NewLaunchArgs ¶
func NewLaunchArgs(manifestID string) *LaunchArgs
NewLaunchArgs initializes LaunchArgs with the required arguments.
func (*LaunchArgs) SetURL ¶
func (a *LaunchArgs) SetURL(url string) *LaunchArgs
SetURL sets the URL optional argument.
type LaunchFilesInAppArgs ¶
type LaunchFilesInAppArgs struct {
ManifestID string `json:"manifestId"` // No description.
Files []string `json:"files"` // No description.
}
LaunchFilesInAppArgs represents the arguments for LaunchFilesInApp in the PWA domain.
func NewLaunchFilesInAppArgs ¶
func NewLaunchFilesInAppArgs(manifestID string, files []string) *LaunchFilesInAppArgs
NewLaunchFilesInAppArgs initializes LaunchFilesInAppArgs with the required arguments.
type LaunchFilesInAppReply ¶
type LaunchFilesInAppReply struct {
TargetIDs []target.ID `json:"targetIds"` // IDs of the tab targets created as the result.
}
LaunchFilesInAppReply represents the return values for LaunchFilesInApp in the PWA domain.
type LaunchReply ¶
type LaunchReply struct {
TargetID target.ID `json:"targetId"` // ID of the tab target created as a result.
}
LaunchReply represents the return values for Launch in the PWA domain.
type OpenCurrentPageInAppArgs ¶
type OpenCurrentPageInAppArgs struct {
ManifestID string `json:"manifestId"` // No description.
}
OpenCurrentPageInAppArgs represents the arguments for OpenCurrentPageInApp in the PWA domain.
func NewOpenCurrentPageInAppArgs ¶
func NewOpenCurrentPageInAppArgs(manifestID string) *OpenCurrentPageInAppArgs
NewOpenCurrentPageInAppArgs initializes OpenCurrentPageInAppArgs with the required arguments.
type UninstallArgs ¶
type UninstallArgs struct {
ManifestID string `json:"manifestId"` // No description.
}
UninstallArgs represents the arguments for Uninstall in the PWA domain.
func NewUninstallArgs ¶
func NewUninstallArgs(manifestID string) *UninstallArgs
NewUninstallArgs initializes UninstallArgs with the required arguments.