blob: 0f8fda3260a8f009a41f289a6141a85df897f40a [file] [log] [blame]
// +build go1.9
// Code generated by cdpgen. DO NOT EDIT.
package page
import (
"github.com/mafredri/cdp/protocol/network"
)
// CreateIsolatedWorldArgs represents the arguments for CreateIsolatedWorld in the Page domain.
type CreateIsolatedWorldArgs struct {
FrameID FrameID `json:"frameId"` // Id of the frame in which the isolated world should be created.
WorldName *string `json:"worldName,omitempty"` // An optional name which is reported in the Execution Context.
GrantUniveralAccess *bool `json:"grantUniveralAccess,omitempty"` // Whether or not universal access should be granted to the isolated world. This is a powerful option, use with caution.
}
// NewCreateIsolatedWorldArgs initializes CreateIsolatedWorldArgs with the required arguments.
func NewCreateIsolatedWorldArgs(frameID FrameID) *CreateIsolatedWorldArgs {
args := new(CreateIsolatedWorldArgs)
args.FrameID = frameID
return args
}
// SetWorldName sets the WorldName optional argument. An optional name
// which is reported in the Execution Context.
func (a *CreateIsolatedWorldArgs) SetWorldName(worldName string) *CreateIsolatedWorldArgs {
a.WorldName = &worldName
return a
}
// SetGrantUniveralAccess sets the GrantUniveralAccess optional argument.
// Whether or not universal access should be granted to the isolated
// world. This is a powerful option, use with caution.
func (a *CreateIsolatedWorldArgs) SetGrantUniveralAccess(grantUniveralAccess bool) *CreateIsolatedWorldArgs {
a.GrantUniveralAccess = &grantUniveralAccess
return a
}
// GetResourceContentArgs represents the arguments for GetResourceContent in the Page domain.
type GetResourceContentArgs struct {
FrameID FrameID `json:"frameId"` // Frame id to get resource for.
URL string `json:"url"` // URL of the resource to get content for.
}
// NewGetResourceContentArgs initializes GetResourceContentArgs with the required arguments.
func NewGetResourceContentArgs(frameID FrameID, url string) *GetResourceContentArgs {
args := new(GetResourceContentArgs)
args.FrameID = frameID
args.URL = url
return args
}
// NavigateArgs represents the arguments for Navigate in the Page domain.
type NavigateArgs struct {
URL string `json:"url"` // URL to navigate the page to.
Referrer *string `json:"referrer,omitempty"` // Referrer URL.
TransitionType TransitionType `json:"transitionType,omitempty"` // Intended transition type.
FrameID *FrameID `json:"frameId,omitempty"` // Frame id to navigate, if not specified navigates the top frame.
}
// NewNavigateArgs initializes NavigateArgs with the required arguments.
func NewNavigateArgs(url string) *NavigateArgs {
args := new(NavigateArgs)
args.URL = url
return args
}
// SetReferrer sets the Referrer optional argument. Referrer URL.
func (a *NavigateArgs) SetReferrer(referrer string) *NavigateArgs {
a.Referrer = &referrer
return a
}
// SetTransitionType sets the TransitionType optional argument.
// Intended transition type.
func (a *NavigateArgs) SetTransitionType(transitionType TransitionType) *NavigateArgs {
a.TransitionType = transitionType
return a
}
// SetFrameID sets the FrameID optional argument. Frame id to
// navigate, if not specified navigates the top frame.
func (a *NavigateArgs) SetFrameID(frameID FrameID) *NavigateArgs {
a.FrameID = &frameID
return a
}
// NavigateReply represents the return values for Navigate in the Page domain.
type NavigateReply struct {
FrameID FrameID `json:"frameId"` // Frame id that has navigated (or failed to navigate)
LoaderID *network.LoaderID `json:"loaderId,omitempty"` // Loader identifier.
ErrorText *string `json:"errorText,omitempty"` // User friendly error message, present if and only if navigation has failed.
}
// SearchInResourceArgs represents the arguments for SearchInResource in the Page domain.
type SearchInResourceArgs struct {
FrameID FrameID `json:"frameId"` // Frame id for resource to search in.
URL string `json:"url"` // URL of the resource to search in.
Query string `json:"query"` // String to search for.
CaseSensitive *bool `json:"caseSensitive,omitempty"` // If true, search is case sensitive.
IsRegex *bool `json:"isRegex,omitempty"` // If true, treats string parameter as regex.
}
// NewSearchInResourceArgs initializes SearchInResourceArgs with the required arguments.
func NewSearchInResourceArgs(frameID FrameID, url string, query string) *SearchInResourceArgs {
args := new(SearchInResourceArgs)
args.FrameID = frameID
args.URL = url
args.Query = query
return args
}
// SetCaseSensitive sets the CaseSensitive optional argument. If true,
// search is case sensitive.
func (a *SearchInResourceArgs) SetCaseSensitive(caseSensitive bool) *SearchInResourceArgs {
a.CaseSensitive = &caseSensitive
return a
}
// SetIsRegex sets the IsRegex optional argument. If true, treats
// string parameter as regex.
func (a *SearchInResourceArgs) SetIsRegex(isRegex bool) *SearchInResourceArgs {
a.IsRegex = &isRegex
return a
}
// SetDocumentContentArgs represents the arguments for SetDocumentContent in the Page domain.
type SetDocumentContentArgs struct {
FrameID FrameID `json:"frameId"` // Frame id to set HTML for.
HTML string `json:"html"` // HTML content to set.
}
// NewSetDocumentContentArgs initializes SetDocumentContentArgs with the required arguments.
func NewSetDocumentContentArgs(frameID FrameID, html string) *SetDocumentContentArgs {
args := new(SetDocumentContentArgs)
args.FrameID = frameID
args.HTML = html
return args
}