MCPcopy Create free account

hub / github.com/chromedp/chromedp / functions

Functions912 in github.com/chromedp/chromedp

↓ 193 callersFunctionDo
Do runs the actions against the target of the context, in order. It stops at the first error. See [Run] for the rules about the context. For example:
action.go:78
↓ 132 callersFunctiontestAllocate
(tb testing.TB, name string)
chromedp_test.go:159
↓ 97 callersFunctionNewContext
NewContext creates a chromedp context from the parent context. The context inherits the Allocator of the parent. By default, that is an ExecAllocator
chromedp.go:187
↓ 84 callersFunctionRun
Run runs the action against the target of the context, and returns its value. The context must be a chromedp context, typically made with [NewContext]
action.go:59
↓ 77 callersMethodCall
Call sends the command to the target, waits for the response, and decodes the result into res. It satisfies [cdp.Session]. Call returns a browser err
target.go:181
↓ 74 callersFunctionNavigate
Navigate is an action that navigates the current frame and waits for the page to load. This action does not collect HTTP response information. To get
nav.go:17
↓ 60 callersFunctioninto
into makes an action that runs a and stores its value in dst. The tests use it to run several actions in one call of Do and still read their values.
chromedp_test.go:146
↓ 44 callersFunctionNewExecAllocator
NewExecAllocator creates a new context with an ExecAllocator. Use it with NewContext.
allocate.go:134
↓ 41 callersFunctionFromContext
FromContext returns the Context that a context.Context holds, or nil.
chromedp.go:324
↓ 40 callersMethodClose
Close satisfies the io.Closer interface. It closes both ends of the pipe, which makes the browser exit.
pipe.go:62
↓ 38 callersMethodError
Error satisfies the error interface.
errors.go:58
↓ 32 callersFunctionFunc
Func makes an action that returns no value from a func that returns only an error.
action.go:98
↓ 27 callersFunctionptr
ptr returns a pointer to a copy of v. It sets the optional fields of the protocol types, which are pointers.
util.go:335
↓ 24 callersFunctionClick
Click is an element query action that sends a mouse click event to the first element node matching the selector.
query.go:1199
↓ 24 callersFunctionFlag
Flag is a generic command line option that passes a flag to Chrome. If the value is a string, Flag passes --name=value. If it is a boolean, Flag passe
allocate.go:704
↓ 24 callersFunctionfirst
first returns the first node of the query result, or an error when the query matched no node.
query.go:221
↓ 22 callersFunctionNodes
Nodes is an element query action that retrieves the document element nodes matching the selector.
query.go:838
↓ 20 callersFunctiono
()
testdata/twgl-full.min.js:6
↓ 19 callersMethodpush
(v jsonv2.Value)
session.go:144
↓ 18 callersFunctionValue
Value is an element query action that retrieves the JavaScript value field of the first element node matching the selector. Use it to read the JavaSc
query.go:999
↓ 16 callersFunctionWaitVisible
WaitVisible is an element query action that waits until the element matching the selector is visible.
query.go:808
↓ 16 callersFunctionqueryDo
queryDo is like QueryAfter for a func that returns no value. A nil f only waits for the nodes.
query.go:210
↓ 15 callersFunctionText
Text is an element query action that retrieves the visible text of the first element node matching the selector.
query.go:911
↓ 15 callersFunctionTitle
Title is an action that retrieves the document title.
nav.go:124
↓ 15 callersMethodWait
Wait blocks until the allocator has freed all of its resources. Canceling the allocator context does this too, so normally you do not need to call Wai
allocate.go:32
↓ 15 callersFunctionwriteHTML
(content string)
example_test.go:26
↓ 14 callersFunctionCancel
Cancel cancels a chromedp context, waits until the context frees its resources, and returns any error that occurred. If the context allocated a brows
chromedp.go:342
↓ 14 callersFunctionQueryAfter
QueryAfter is an element query action that queries the browser for selector sel. It waits until the node conditions of the query are met, then runs f
query.go:195
↓ 13 callersFunctionCall
Call runs the protocol command with the params on the target of the chromedp context, and returns its result. As [Run] does, it starts the browser and
call.go:22
↓ 13 callersFunctionEvents
Events subscribes to the event on the target of the context, and returns an iterator over its payloads. It replaces ListenTarget. The subscription st
action.go:141
↓ 13 callersFunctionb
(e)
testdata/twgl-full.min.js:6
↓ 12 callersFunctionn
(e)
testdata/twgl-full.min.js:6
↓ 12 callersFunctionwithOpts
withOpts returns the options followed by the extra options, without changing the array of opts.
query.go:230
↓ 11 callersMethodWrite
(context.Context, *cdproto.Message)
browser.go:44
↓ 10 callersFunctionNewAllocator
NewAllocator creates a new context with an [Allocator]. Use it with chromedp.NewContext. The url must point to the websocket address of the browser, s
remote/allocator.go:32
↓ 10 callersFunctionf
(e,r,t,n,o,u,i)
testdata/twgl-full.min.js:6
↓ 9 callersMethodClose
Close satisfies the io.Closer interface.
remote/conn.go:106
↓ 9 callersFunctionQuery
Query is an action that queries the browser for element nodes that match the criteria, and waits until they meet the node conditions. It returns no va
query.go:188
↓ 9 callersFunctiontestAllocateSeparate
(tb testing.TB)
chromedp_test.go:187
↓ 8 callersFunctionExecPath
ExecPath returns an ExecAllocatorOption that uses the given path to run browser processes. The path can be an absolute path to a binary, or the name o
allocate.go:618
↓ 8 callersFunctionExposeFunc
ExposeFunc is an action that makes the Go func fn available to the page as window.<name>. A page script calls it like an async function. The call retu
expose.go:67
↓ 8 callersFunctionQueryNodeIDs
QueryNodeIDs is an element query action that retrieves the element node IDs matching the selector.
query.go:846
↓ 8 callersMethodString
String returns the name of the node type.
node.go:327
↓ 8 callersMethodString
String returns the text that was written.
remote/websocket_test.go:162
↓ 8 callersFunctionsetupExecAllocator
setupExecAllocator is like NewExecAllocator, but NewContext uses it to create the allocator without an extra context layer.
allocate.go:53
↓ 8 callersFunctiont
(n)
testdata/twgl-full.min.js:6
↓ 8 callersFunctionv
(e,r)
testdata/twgl-full.min.js:6
↓ 8 callersFunctiony
(e)
testdata/twgl-full.min.js:6
↓ 7 callersFunctionAllocate
Allocate returns the context of a new tab in the browser that all tests share, and a func that closes the tab. The first call starts the browser. If n
internal/chromedptest/chromedptest.go:216
↓ 7 callersFunctionDialContext
DialContext dials the websocket URL with gobwas/ws.
remote/conn.go:59
↓ 7 callersFunctionInto
Into makes an action that runs a and stores its value in dst. The tests use it to run several actions in one call of chromedp.Do and still read their
internal/chromedptest/chromedptest.go:202
↓ 7 callersFunctionKeptOpen
KeptOpen returns the websocket address of the browser of the context and the user data directory of the browser, so that a program can print them. Ano
keepopen.go:73
↓ 7 callersMethodRead
(context.Context, *cdproto.Message)
browser.go:43
↓ 7 callersFunctionUserDataDir
UserDataDir is the command line option to set the user data directory. Use it to choose the profile directory of Chrome. Without it, ExecAllocator cre
allocate.go:780
↓ 7 callersFunctionWaitFunc
WaitFunc is an element query option to set a custom node condition wait.
query.go:593
↓ 7 callersFunctiona
(e)
testdata/twgl-full.min.js:6
↓ 7 callersFunctionread
(t *testing.T, path string)
docs/docs_test.go:275
↓ 7 callersFunctionselectedIDs
selectedIDs runs Nodes with the selector and returns the id attribute of each node that it selects.
query_test.go:1607
↓ 6 callersFunctionCallBrowser
CallBrowser runs the protocol command with the params on the browser of the chromedp context, and returns its result. Use it for the commands of the b
call.go:38
↓ 6 callersFunctionCombinedOutput
CombinedOutput sets the io.Writer that receives the stdout and stderr of the browser.
allocate.go:898
↓ 6 callersMethodDo
Do runs the action. The context holds the chromedp context.
action.go:108
↓ 6 callersFunctionEmulateViewport
EmulateViewport is an action that changes the browser viewport. It wraps calls to emulation.SetDeviceMetricsOverride and emulation.SetTouchEmulationE
emulate.go:20
↓ 6 callersFunctionJ
(e,r,t,n)
testdata/twgl-full.min.js:6
↓ 6 callersFunctionModifyCmdFunc
ModifyCmdFunc runs a func on the exec.Cmd of the browser. It replaces the default func, which sends SIGKILL to any open browsers when the Go program e
allocate.go:771
↓ 6 callersFunctionNewPipeConn
NewPipeConn returns a Transport that reads the messages of the browser from r and writes the messages for the browser to w. Close closes both r and w.
pipe.go:48
↓ 6 callersFunctionWithTargetID
WithTargetID makes a context attach to an existing target, and not create a new one. It also works for an iframe from another site (a cross-site ifra
chromedp.go:723
↓ 6 callersFunctions
(e,r)
testdata/twgl-full.min.js:6
↓ 6 callersFunctionue
(e,r,t)
testdata/twgl-full.min.js:6
↓ 6 callersFunctionwebsocketOpts
websocketOpts returns the options of the exec allocator in the websocket mode, followed by extra.
remote/websocket_test.go:26
↓ 5 callersFunctionAtLeast
AtLeast is an element query option that sets the minimum number of elements that the query must return. By default, a query needs 1.
query.go:737
↓ 5 callersFunctionAttributeValue
AttributeValue is an element query action that retrieves the element attribute value for the first element node matching the selector. The result tell
query.go:1089
↓ 5 callersFunctionConsole
Console subscribes to the console of the target of the context, and returns an iterator over its messages. A message is a call of the console API such
console.go:130
↓ 5 callersFunctionDragAndDrop
DragAndDrop is an element query action that drags the first element node that matches from, and drops it on the first element node that matches to. It
drag.go:47
↓ 5 callersFunctionPrintToPDF
PrintToPDF is an action that prints the page to a PDF file, and returns the bytes of the file. With no option, the browser prints on Letter paper, in
pdf.go:61
↓ 5 callersFunctionRunResponse
RunResponse is an alternative to [Do] for a list of actions that trigger a page navigation, such as a click on a link or a button. RunResponse runs t
chromedp.go:796
↓ 5 callersFunctionWaitReady
WaitReady is an element query action that waits until the element that matches the selector is ready (that is, "loaded").
query.go:802
↓ 5 callersFunctionWithDialer
WithDialer is an ExecAllocatorOption that makes the allocator connect to the browser with a websocket, as chromedp did before the pipe became the defa
allocate.go:915
↓ 5 callersFunctionWithLogf
WithLogf is a shortcut for WithBrowserOption(WithBrowserLogf(f)).
chromedp.go:760
↓ 5 callersFunctionWithPollingTimeout
WithPollingTimeout sets the maximum time to wait until the predicate returns a truthy value. It defaults to 30 seconds. Pass 0 to disable the timeout.
poll.go:157
↓ 5 callersFunctionWithVisibleWindow
WithVisibleWindow makes NewContext build the default allocator with [VisibleWindow] and without Headless, so that the browser opens a visible window.
chromedp.go:638
↓ 5 callersFunctiongrab
grab retrieves a file from the chromium source code. It tries each source in order and returns the first file that it can download and that is not emp
kb/gen.go:461
↓ 5 callersFunctioninitContextBrowser
(ctx context.Context)
chromedp.go:387
↓ 5 callersFunctioninitContextTarget
initContextTarget is like initContextBrowser, and also attaches the target of the context when it has none yet.
chromedp.go:435
↓ 5 callersFunctionmatchPixel
(buf []byte, want string)
test/screenshot_test.go:226
↓ 5 callersFunctionwaitLoad
waitLoad makes an action that runs the steps and waits until the page loads. It does not return the response.
chromedp.go:942
↓ 5 callersMethodwaitReady
waitReady waits for the specified nodes to be ready.
query.go:331
↓ 5 callersFunctionwalk
(m map[cdp.NodeID]*Node, n *Node)
util.go:60
↓ 4 callersFunction$
()
testdata/twgl-full.min.js:6
↓ 4 callersMethodClose
()
pipe_test.go:24
↓ 4 callersFunctionLocation
Location is an action that retrieves the document location.
nav.go:119
↓ 4 callersFunctionMouseClickNode
MouseClickNode is an action that dispatches a left mouse button click event at the center of a node. Note: the action scrolls the window if the node
input.go:79
↓ 4 callersFunctionN
(e,r,t)
testdata/twgl-full.min.js:6
↓ 4 callersFunctionNewBrowserTransport
NewBrowserTransport creates a new browser that uses tr, a connection to a browser that is already open, such as a [*PipeConn]. The browser closes tr w
browser.go:139
↓ 4 callersFunctionPDFLandscape
PDFLandscape is an option of [PrintToPDF] that prints in landscape. The width and the height of the paper swap.
pdf.go:104
↓ 4 callersFunctionPDFMargin
PDFMargin is an option of [PrintToPDF] that sets the four margins to the same length in inches. The default is 1 cm, which is about 0.4 inches. A marg
pdf.go:122
↓ 4 callersFunctionPDFPaper
PDFPaper is an option of [PrintToPDF] that sets the size of the paper. Give one of the sizes of the package, such as [PaperA4], or a [PaperSize] of yo
pdf.go:113
↓ 4 callersMethodProcess
Process returns the process object of the browser. It is nil when the browser was allocated by an allocator that attaches to a browser that runs alre
browser.go:189
↓ 4 callersFunctionScreenshot
Screenshot is an element query action that takes a screenshot of the first element node that matches the selector. It acts like the command "Capture
screenshot.go:30
↓ 4 callersFunctionSendKeys
SendKeys is an element query action that sends key events to the first element node that matches the selector. It synthesizes the key down, char, and
query.go:1285
↓ 4 callersFunctionWithDebugf
WithDebugf is a shortcut for WithBrowserOption(WithBrowserDebugf(f)).
chromedp.go:770
next →1–100 of 912, ranked by callers