_id stringlengths 2 7 | title stringlengths 1 118 | partition stringclasses 3 values | text stringlengths 52 85.5k | language stringclasses 1 value | meta_information dict |
|---|---|---|---|---|---|
q179800 | Do | test | func (p *SynthesizeScrollGestureParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSynthesizeScrollGesture, p, nil)
} | go | {
"resource": ""
} |
q179801 | Do | test | func (p *SynthesizeTapGestureParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSynthesizeTapGesture, p, nil)
} | go | {
"resource": ""
} |
q179802 | Domain | test | func (t MethodType) Domain() string {
return string(t[:strings.IndexByte(string(t), '.')])
} | go | {
"resource": ""
} |
q179803 | WithDepth | test | func (p GetEventListenersParams) WithDepth(depth int64) *GetEventListenersParams {
p.Depth = depth
return &p
} | go | {
"resource": ""
} |
q179804 | Do | test | func (p *RemoveDOMBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveDOMBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179805 | WithTargetName | test | func (p RemoveEventListenerBreakpointParams) WithTargetName(targetName string) *RemoveEventListenerBreakpointParams {
p.TargetName = targetName
return &p
} | go | {
"resource": ""
} |
q179806 | Do | test | func (p *RemoveEventListenerBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveEventListenerBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179807 | Do | test | func (p *RemoveInstrumentationBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveInstrumentationBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179808 | Do | test | func (p *RemoveXHRBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveXHRBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179809 | Do | test | func (p *SetDOMBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDOMBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179810 | Do | test | func (p *SetEventListenerBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetEventListenerBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179811 | Do | test | func (p *SetInstrumentationBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetInstrumentationBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179812 | Do | test | func (p *SetXHRBreakpointParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetXHRBreakpoint, p, nil)
} | go | {
"resource": ""
} |
q179813 | WithExecutor | test | func WithExecutor(parent context.Context, executor Executor) context.Context {
return context.WithValue(parent, executorKey, executor)
} | go | {
"resource": ""
} |
q179814 | Execute | test | func Execute(ctx context.Context, method string, params easyjson.Marshaler, res easyjson.Unmarshaler) error {
if executor := ctx.Value(executorKey); executor != nil {
return executor.(Executor).Execute(ctx, method, params, res)
}
return ErrInvalidContext
} | go | {
"resource": ""
} |
q179815 | AttributeValue | test | func (n *Node) AttributeValue(name string) string {
n.RLock()
defer n.RUnlock()
for i := 0; i < len(n.Attributes); i += 2 {
if n.Attributes[i] == name {
return n.Attributes[i+1]
}
}
return ""
} | go | {
"resource": ""
} |
q179816 | xpath | test | func (n *Node) xpath(stopAtDocument, stopAtID bool) string {
n.RLock()
defer n.RUnlock()
p := ""
pos := ""
id := n.AttributeValue("id")
switch {
case n.Parent == nil:
return n.LocalName
case stopAtDocument && n.NodeType == NodeTypeDocument:
return ""
case stopAtID && id != "":
p = "/"
pos = `[@id='` + id + `']`
case n.Parent != nil:
var i int
var found bool
n.Parent.RLock()
for j := 0; j < len(n.Parent.Children); j++ {
if n.Parent.Children[j].LocalName == n.LocalName {
i++
}
if n.Parent.Children[j].NodeID == n.NodeID {
found = true
break
}
}
n.Parent.RUnlock()
if found {
pos = "[" + strconv.Itoa(i) + "]"
}
p = n.Parent.xpath(stopAtDocument, stopAtID)
}
return p + "/" + n.LocalName + pos
} | go | {
"resource": ""
} |
q179817 | String | test | func (t NodeType) String() string {
switch t {
case NodeTypeElement:
return "Element"
case NodeTypeAttribute:
return "Attribute"
case NodeTypeText:
return "Text"
case NodeTypeCDATA:
return "CDATA"
case NodeTypeEntityReference:
return "EntityReference"
case NodeTypeEntity:
return "Entity"
case NodeTypeProcessingInstruction:
return "ProcessingInstruction"
case NodeTypeComment:
return "Comment"
case NodeTypeDocument:
return "Document"
case NodeTypeDocumentType:
return "DocumentType"
case NodeTypeDocumentFragment:
return "DocumentFragment"
case NodeTypeNotation:
return "Notation"
}
return fmt.Sprintf("NodeType(%d)", t)
} | go | {
"resource": ""
} |
q179818 | Do | test | func (p *SetSinkToUseParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetSinkToUse, p, nil)
} | go | {
"resource": ""
} |
q179819 | Do | test | func (p *StartTabMirroringParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStartTabMirroring, p, nil)
} | go | {
"resource": ""
} |
q179820 | Do | test | func (p *StopCastingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopCasting, p, nil)
} | go | {
"resource": ""
} |
q179821 | Do | test | func (p *StartObservingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStartObserving, p, nil)
} | go | {
"resource": ""
} |
q179822 | Do | test | func (p *StopObservingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopObserving, p, nil)
} | go | {
"resource": ""
} |
q179823 | Do | test | func (p *SetRecordingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetRecording, p, nil)
} | go | {
"resource": ""
} |
q179824 | Do | test | func (p *ClearEventsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearEvents, p, nil)
} | go | {
"resource": ""
} |
q179825 | WithObjectID | test | func (p CallFunctionOnParams) WithObjectID(objectID RemoteObjectID) *CallFunctionOnParams {
p.ObjectID = objectID
return &p
} | go | {
"resource": ""
} |
q179826 | WithArguments | test | func (p CallFunctionOnParams) WithArguments(arguments []*CallArgument) *CallFunctionOnParams {
p.Arguments = arguments
return &p
} | go | {
"resource": ""
} |
q179827 | WithExecutionContextID | test | func (p CallFunctionOnParams) WithExecutionContextID(executionContextID ExecutionContextID) *CallFunctionOnParams {
p.ExecutionContextID = executionContextID
return &p
} | go | {
"resource": ""
} |
q179828 | WithObjectGroup | test | func (p CallFunctionOnParams) WithObjectGroup(objectGroup string) *CallFunctionOnParams {
p.ObjectGroup = objectGroup
return &p
} | go | {
"resource": ""
} |
q179829 | Do | test | func (p *DiscardConsoleEntriesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDiscardConsoleEntries, nil, nil)
} | go | {
"resource": ""
} |
q179830 | WithContextID | test | func (p EvaluateParams) WithContextID(contextID ExecutionContextID) *EvaluateParams {
p.ContextID = contextID
return &p
} | go | {
"resource": ""
} |
q179831 | WithOwnProperties | test | func (p GetPropertiesParams) WithOwnProperties(ownProperties bool) *GetPropertiesParams {
p.OwnProperties = ownProperties
return &p
} | go | {
"resource": ""
} |
q179832 | WithGeneratePreview | test | func (p GetPropertiesParams) WithGeneratePreview(generatePreview bool) *GetPropertiesParams {
p.GeneratePreview = generatePreview
return &p
} | go | {
"resource": ""
} |
q179833 | WithExecutionContextID | test | func (p GlobalLexicalScopeNamesParams) WithExecutionContextID(executionContextID ExecutionContextID) *GlobalLexicalScopeNamesParams {
p.ExecutionContextID = executionContextID
return &p
} | go | {
"resource": ""
} |
q179834 | WithObjectGroup | test | func (p QueryObjectsParams) WithObjectGroup(objectGroup string) *QueryObjectsParams {
p.ObjectGroup = objectGroup
return &p
} | go | {
"resource": ""
} |
q179835 | Do | test | func (p *ReleaseObjectParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandReleaseObject, p, nil)
} | go | {
"resource": ""
} |
q179836 | Do | test | func (p *ReleaseObjectGroupParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandReleaseObjectGroup, p, nil)
} | go | {
"resource": ""
} |
q179837 | Do | test | func (p *RunIfWaitingForDebuggerParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRunIfWaitingForDebugger, nil, nil)
} | go | {
"resource": ""
} |
q179838 | Do | test | func (p *SetCustomObjectFormatterEnabledParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetCustomObjectFormatterEnabled, p, nil)
} | go | {
"resource": ""
} |
q179839 | Do | test | func (p *SetMaxCallStackSizeToCaptureParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetMaxCallStackSizeToCapture, p, nil)
} | go | {
"resource": ""
} |
q179840 | Do | test | func (p *TerminateExecutionParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandTerminateExecution, nil, nil)
} | go | {
"resource": ""
} |
q179841 | Do | test | func (p *AddBindingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandAddBinding, p, nil)
} | go | {
"resource": ""
} |
q179842 | Do | test | func (p *RemoveBindingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveBinding, p, nil)
} | go | {
"resource": ""
} |
q179843 | Do | test | func (p *EndParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandEnd, nil, nil)
} | go | {
"resource": ""
} |
q179844 | Do | test | func (p *RecordClockSyncMarkerParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRecordClockSyncMarker, p, nil)
} | go | {
"resource": ""
} |
q179845 | WithBufferUsageReportingInterval | test | func (p StartParams) WithBufferUsageReportingInterval(bufferUsageReportingInterval float64) *StartParams {
p.BufferUsageReportingInterval = bufferUsageReportingInterval
return &p
} | go | {
"resource": ""
} |
q179846 | WithNoDisplayUpdates | test | func (p BeginFrameParams) WithNoDisplayUpdates(noDisplayUpdates bool) *BeginFrameParams {
p.NoDisplayUpdates = noDisplayUpdates
return &p
} | go | {
"resource": ""
} |
q179847 | WithScreenshot | test | func (p BeginFrameParams) WithScreenshot(screenshot *ScreenshotParams) *BeginFrameParams {
p.Screenshot = screenshot
return &p
} | go | {
"resource": ""
} |
q179848 | Do | test | func (p *BringToFrontParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandBringToFront, nil, nil)
} | go | {
"resource": ""
} |
q179849 | WithClip | test | func (p CaptureScreenshotParams) WithClip(clip *Viewport) *CaptureScreenshotParams {
p.Clip = clip
return &p
} | go | {
"resource": ""
} |
q179850 | WithFromSurface | test | func (p CaptureScreenshotParams) WithFromSurface(fromSurface bool) *CaptureScreenshotParams {
p.FromSurface = fromSurface
return &p
} | go | {
"resource": ""
} |
q179851 | WithWorldName | test | func (p CreateIsolatedWorldParams) WithWorldName(worldName string) *CreateIsolatedWorldParams {
p.WorldName = worldName
return &p
} | go | {
"resource": ""
} |
q179852 | WithGrantUniveralAccess | test | func (p CreateIsolatedWorldParams) WithGrantUniveralAccess(grantUniveralAccess bool) *CreateIsolatedWorldParams {
p.GrantUniveralAccess = grantUniveralAccess
return &p
} | go | {
"resource": ""
} |
q179853 | Do | test | func (p *ResetNavigationHistoryParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandResetNavigationHistory, nil, nil)
} | go | {
"resource": ""
} |
q179854 | WithPromptText | test | func (p HandleJavaScriptDialogParams) WithPromptText(promptText string) *HandleJavaScriptDialogParams {
p.PromptText = promptText
return &p
} | go | {
"resource": ""
} |
q179855 | Do | test | func (p *HandleJavaScriptDialogParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandHandleJavaScriptDialog, p, nil)
} | go | {
"resource": ""
} |
q179856 | WithReferrer | test | func (p NavigateParams) WithReferrer(referrer string) *NavigateParams {
p.Referrer = referrer
return &p
} | go | {
"resource": ""
} |
q179857 | WithTransitionType | test | func (p NavigateParams) WithTransitionType(transitionType TransitionType) *NavigateParams {
p.TransitionType = transitionType
return &p
} | go | {
"resource": ""
} |
q179858 | WithFrameID | test | func (p NavigateParams) WithFrameID(frameID cdp.FrameID) *NavigateParams {
p.FrameID = frameID
return &p
} | go | {
"resource": ""
} |
q179859 | Do | test | func (p *NavigateToHistoryEntryParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandNavigateToHistoryEntry, p, nil)
} | go | {
"resource": ""
} |
q179860 | WithLandscape | test | func (p PrintToPDFParams) WithLandscape(landscape bool) *PrintToPDFParams {
p.Landscape = landscape
return &p
} | go | {
"resource": ""
} |
q179861 | WithDisplayHeaderFooter | test | func (p PrintToPDFParams) WithDisplayHeaderFooter(displayHeaderFooter bool) *PrintToPDFParams {
p.DisplayHeaderFooter = displayHeaderFooter
return &p
} | go | {
"resource": ""
} |
q179862 | WithPrintBackground | test | func (p PrintToPDFParams) WithPrintBackground(printBackground bool) *PrintToPDFParams {
p.PrintBackground = printBackground
return &p
} | go | {
"resource": ""
} |
q179863 | WithScale | test | func (p PrintToPDFParams) WithScale(scale float64) *PrintToPDFParams {
p.Scale = scale
return &p
} | go | {
"resource": ""
} |
q179864 | WithPaperWidth | test | func (p PrintToPDFParams) WithPaperWidth(paperWidth float64) *PrintToPDFParams {
p.PaperWidth = paperWidth
return &p
} | go | {
"resource": ""
} |
q179865 | WithPaperHeight | test | func (p PrintToPDFParams) WithPaperHeight(paperHeight float64) *PrintToPDFParams {
p.PaperHeight = paperHeight
return &p
} | go | {
"resource": ""
} |
q179866 | WithIgnoreInvalidPageRanges | test | func (p PrintToPDFParams) WithIgnoreInvalidPageRanges(ignoreInvalidPageRanges bool) *PrintToPDFParams {
p.IgnoreInvalidPageRanges = ignoreInvalidPageRanges
return &p
} | go | {
"resource": ""
} |
q179867 | WithFooterTemplate | test | func (p PrintToPDFParams) WithFooterTemplate(footerTemplate string) *PrintToPDFParams {
p.FooterTemplate = footerTemplate
return &p
} | go | {
"resource": ""
} |
q179868 | WithPreferCSSPageSize | test | func (p PrintToPDFParams) WithPreferCSSPageSize(preferCSSPageSize bool) *PrintToPDFParams {
p.PreferCSSPageSize = preferCSSPageSize
return &p
} | go | {
"resource": ""
} |
q179869 | WithScriptToEvaluateOnLoad | test | func (p ReloadParams) WithScriptToEvaluateOnLoad(scriptToEvaluateOnLoad string) *ReloadParams {
p.ScriptToEvaluateOnLoad = scriptToEvaluateOnLoad
return &p
} | go | {
"resource": ""
} |
q179870 | Do | test | func (p *ReloadParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandReload, p, nil)
} | go | {
"resource": ""
} |
q179871 | Do | test | func (p *RemoveScriptToEvaluateOnNewDocumentParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandRemoveScriptToEvaluateOnNewDocument, p, nil)
} | go | {
"resource": ""
} |
q179872 | Do | test | func (p *ScreencastFrameAckParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandScreencastFrameAck, p, nil)
} | go | {
"resource": ""
} |
q179873 | Do | test | func (p *SetAdBlockingEnabledParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetAdBlockingEnabled, p, nil)
} | go | {
"resource": ""
} |
q179874 | Do | test | func (p *SetBypassCSPParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetBypassCSP, p, nil)
} | go | {
"resource": ""
} |
q179875 | Do | test | func (p *SetFontFamiliesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetFontFamilies, p, nil)
} | go | {
"resource": ""
} |
q179876 | Do | test | func (p *SetFontSizesParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetFontSizes, p, nil)
} | go | {
"resource": ""
} |
q179877 | Do | test | func (p *SetDocumentContentParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDocumentContent, p, nil)
} | go | {
"resource": ""
} |
q179878 | WithDownloadPath | test | func (p SetDownloadBehaviorParams) WithDownloadPath(downloadPath string) *SetDownloadBehaviorParams {
p.DownloadPath = downloadPath
return &p
} | go | {
"resource": ""
} |
q179879 | Do | test | func (p *SetDownloadBehaviorParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetDownloadBehavior, p, nil)
} | go | {
"resource": ""
} |
q179880 | Do | test | func (p *SetLifecycleEventsEnabledParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetLifecycleEventsEnabled, p, nil)
} | go | {
"resource": ""
} |
q179881 | WithFormat | test | func (p StartScreencastParams) WithFormat(format ScreencastFormat) *StartScreencastParams {
p.Format = format
return &p
} | go | {
"resource": ""
} |
q179882 | WithMaxWidth | test | func (p StartScreencastParams) WithMaxWidth(maxWidth int64) *StartScreencastParams {
p.MaxWidth = maxWidth
return &p
} | go | {
"resource": ""
} |
q179883 | WithMaxHeight | test | func (p StartScreencastParams) WithMaxHeight(maxHeight int64) *StartScreencastParams {
p.MaxHeight = maxHeight
return &p
} | go | {
"resource": ""
} |
q179884 | WithEveryNthFrame | test | func (p StartScreencastParams) WithEveryNthFrame(everyNthFrame int64) *StartScreencastParams {
p.EveryNthFrame = everyNthFrame
return &p
} | go | {
"resource": ""
} |
q179885 | Do | test | func (p *StartScreencastParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStartScreencast, p, nil)
} | go | {
"resource": ""
} |
q179886 | Do | test | func (p *StopLoadingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopLoading, nil, nil)
} | go | {
"resource": ""
} |
q179887 | Do | test | func (p *SetWebLifecycleStateParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetWebLifecycleState, p, nil)
} | go | {
"resource": ""
} |
q179888 | Do | test | func (p *StopScreencastParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopScreencast, nil, nil)
} | go | {
"resource": ""
} |
q179889 | Do | test | func (p *SetProduceCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetProduceCompilationCache, p, nil)
} | go | {
"resource": ""
} |
q179890 | Do | test | func (p *AddCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandAddCompilationCache, p, nil)
} | go | {
"resource": ""
} |
q179891 | Do | test | func (p *ClearCompilationCacheParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearCompilationCache, nil, nil)
} | go | {
"resource": ""
} |
q179892 | WithGroup | test | func (p GenerateTestReportParams) WithGroup(group string) *GenerateTestReportParams {
p.Group = group
return &p
} | go | {
"resource": ""
} |
q179893 | Do | test | func (p *WaitForDebuggerParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandWaitForDebugger, nil, nil)
} | go | {
"resource": ""
} |
q179894 | Do | test | func (p *ActivateTargetParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandActivateTarget, p, nil)
} | go | {
"resource": ""
} |
q179895 | WithBindingName | test | func (p ExposeDevToolsProtocolParams) WithBindingName(bindingName string) *ExposeDevToolsProtocolParams {
p.BindingName = bindingName
return &p
} | go | {
"resource": ""
} |
q179896 | Do | test | func (p *ExposeDevToolsProtocolParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandExposeDevToolsProtocol, p, nil)
} | go | {
"resource": ""
} |
q179897 | WithBrowserContextID | test | func (p CreateTargetParams) WithBrowserContextID(browserContextID BrowserContextID) *CreateTargetParams {
p.BrowserContextID = browserContextID
return &p
} | go | {
"resource": ""
} |
q179898 | WithSessionID | test | func (p DetachFromTargetParams) WithSessionID(sessionID SessionID) *DetachFromTargetParams {
p.SessionID = sessionID
return &p
} | go | {
"resource": ""
} |
q179899 | Do | test | func (p *DetachFromTargetParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandDetachFromTarget, p, nil)
} | go | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.