1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- // Package pwa provides the Chrome DevTools Protocol
- // commands, types, and events for the PWA domain.
- //
- // This domain allows interacting with the browser to control PWAs.
- //
- // Generated by the cdproto-gen command.
- package pwa
- // Code generated by cdproto-gen. DO NOT EDIT.
- import (
- "context"
- "github.com/chromedp/cdproto/cdp"
- )
- // GetOsAppStateParams returns the following OS state for the given manifest
- // id.
- type GetOsAppStateParams 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.
- }
- // GetOsAppState returns the following OS state for the given manifest id.
- //
- // See: https://chromedevtools.github.io/devtools-protocol/tot/PWA#method-getOsAppState
- //
- // parameters:
- //
- // 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.
- func GetOsAppState(manifestID string) *GetOsAppStateParams {
- return &GetOsAppStateParams{
- ManifestID: manifestID,
- }
- }
- // GetOsAppStateReturns return values.
- type GetOsAppStateReturns struct {
- BadgeCount int64 `json:"badgeCount,omitempty"`
- FileHandlers []*FileHandler `json:"fileHandlers,omitempty"`
- }
- // Do executes PWA.getOsAppState against the provided context.
- //
- // returns:
- //
- // badgeCount
- // fileHandlers
- func (p *GetOsAppStateParams) Do(ctx context.Context) (badgeCount int64, fileHandlers []*FileHandler, err error) {
- // execute
- var res GetOsAppStateReturns
- err = cdp.Execute(ctx, CommandGetOsAppState, p, &res)
- if err != nil {
- return 0, nil, err
- }
- return res.BadgeCount, res.FileHandlers, nil
- }
- // Command names.
- const (
- CommandGetOsAppState = "PWA.getOsAppState"
- )
|