MCPcopy Create free account

hub / github.com/chromedp/chromedp / functions

Functions1,064 in github.com/chromedp/chromedp

↓ 203 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:79
↓ 142 callersFunctiontestAllocate
(tb testing.TB, name string)
chromedp_test.go:159
↓ 104 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:196
↓ 91 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:60
↓ 80 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:269
↓ 78 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
↓ 48 callersFunctionFromContext
FromContext returns the Context that a context.Context holds, or nil.
chromedp.go:333
↓ 44 callersFunctionNewExecAllocator
NewExecAllocator creates a new context with an ExecAllocator. Use it with NewContext.
allocate.go:134
↓ 40 callersMethodClose
Close satisfies the io.Closer interface. It closes both ends of the pipe, which makes the browser exit.
pipe.go:62
↓ 37 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:99
↓ 28 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
↓ 27 callersMethodClose
Close sends a close frame with the code 1000 if it can do that in a short time. Then it waits for at most one second for the close frame of the server
remote/internal/websocket/conn.go:408
↓ 25 callersMethodDial
Dial connects to a ws or wss address and runs the opening handshake of RFC 6455 section 4.1. It uses net/http for the request, so it handles the defau
remote/internal/websocket/handshake.go:74
↓ 25 callersMethodReadMessage
ReadMessage reads the next text or binary message. It joins the fragments of a message, answers a ping with a pong, and skips a pong. The returned byt
remote/internal/websocket/conn.go:144
↓ 24 callersFunctionClick
Click is an element query action that sends a mouse click event to the first element node matching the selector.
query.go:1200
↓ 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 callersFunctionNodes
Nodes is an element query action that retrieves the document element nodes matching the selector.
query.go:839
↓ 24 callersFunctionfirst
first returns the first node of the query result, or an error when the query matched no node.
query.go:221
↓ 20 callersFunctiono
()
testdata/twgl-full.min.js:6
↓ 19 callersMethodpush
(v jsonv2.Value)
session.go:144
↓ 18 callersMethodError
Error returns the code and the reason.
remote/internal/websocket/close.go:59
↓ 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:1000
↓ 17 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
↓ 17 callersFunctionWaitVisible
WaitVisible is an element query action that waits until the element matching the selector is visible.
query.go:809
↓ 17 callersMethodWrite
(context.Context, *cdproto.Message)
browser.go:44
↓ 16 callersFunctionText
Text is an element query action that retrieves the visible text of the first element node matching the selector.
query.go:912
↓ 16 callersFunctionTitle
Title is an action that retrieves the document title.
nav.go:124
↓ 16 callersFunctionURL
URL returns the ws address of an HTTP test server.
remote/internal/wstest/wstest.go:135
↓ 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 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:351
↓ 15 callersFunctionnewTestConn
newTestConn makes a Conn that reads the given bytes.
remote/internal/websocket/conn_test.go:48
↓ 15 callersFunctionwriteHTML
(content string)
example_test.go:26
↓ 14 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
↓ 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 callersFunctionEvents
Events subscribes to the event on the target of the context, and returns an iterator over its payloads. It replaces ListenTarget. Use [Listen] when th
action.go:143
↓ 13 callersFunctionb
(e)
testdata/twgl-full.min.js:6
↓ 13 callersMethodwritten
()
remote/internal/websocket/conn_test.go:41
↓ 12 callersMethodRead
(context.Context, *cdproto.Message)
browser.go:43
↓ 12 callersFunctionframe
frame builds an unmasked server frame by hand.
remote/internal/websocket/conn_test.go:104
↓ 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 callersMethodClose
Close satisfies the io.Closer interface.
remote/conn.go:88
↓ 11 callersMethodReadFrame
ReadFrame reads one frame from the client and unmasks it. It gives up after five seconds. It fails when the client does not mask the frame, as RFC 645
remote/internal/wstest/wstest.go:178
↓ 11 callersFunctionparseClientFrames
parseClientFrames parses the bytes that the client wrote. It does so with its own code, and it fails when a frame is not masked.
remote/internal/websocket/conn_test.go:67
↓ 10 callersFunctionDialContext
DialContext dials the websocket URL.
remote/conn.go:56
↓ 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 callersMethodWriteText
WriteText sends p as one text frame. RFC 6455 section 5.6 asks the caller for valid UTF-8. Chrome does not support incoming fragments, so the method n
remote/internal/websocket/conn.go:314
↓ 10 callersFunctioncat
(parts ...[]byte)
remote/internal/websocket/conn_test.go:122
↓ 10 callersFunctionf
(e,r,t,n,o,u,i)
testdata/twgl-full.min.js:6
↓ 9 callersMethodDo
Do runs the action. The context holds the chromedp context.
action.go:109
↓ 9 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
↓ 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 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
↓ 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 callersFunctionQueryNodeIDs
QueryNodeIDs is an element query action that retrieves the element node IDs matching the selector.
query.go:847
↓ 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 callersMethodget
()
remote/internal/websocket/handshake.go:263
↓ 8 callersFunctionmustHex
mustHex decodes a hex string. A space is allowed.
remote/internal/websocket/frame_test.go:14
↓ 8 callersMethodset
(c net.Conn)
remote/internal/websocket/handshake.go:257
↓ 8 callersFunctionsetupExecAllocator
setupExecAllocator is like NewExecAllocator, but NewContext uses it to create the allocator without an extra context layer.
allocate.go:53
↓ 8 callersMethodsnapshot
snapshot returns the events that the recorder holds now.
listen_test.go:32
↓ 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 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 callersFunctionNewServer
NewServer starts a test server that upgrades each request and calls handle with the request and the connection. It closes the connection when handle r
remote/internal/wstest/wstest.go:113
↓ 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:594
↓ 7 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:742
↓ 7 callersMethodWriteFrame
WriteFrame sends an unmasked frame with the FIN bit set.
remote/internal/wstest/wstest.go:160
↓ 7 callersFunctiona
(e)
testdata/twgl-full.min.js:6
↓ 7 callersMethodlisten
listen adds a func that the target calls for each event. Canceling ctx stops the calls. The target calls the func synchronously, so the func must not
chromedp.go:1082
↓ 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 callersFunctionCombinedOutput
CombinedOutput sets the io.Writer that receives the stdout and stderr of the browser.
allocate.go:898
↓ 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 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:159
↓ 6 callersFunctioninitContextBrowser
(ctx context.Context)
chromedp.go:396
↓ 6 callersFunctioninitContextTarget
initContextTarget is like initContextBrowser, and also attaches the target of the context when it has none yet.
chromedp.go:444
↓ 6 callersFunctionnewWebsocketServer
newWebsocketServer starts a server that upgrades each request to a websocket and passes the connection to handle. It returns the ws address.
remote/conn_test.go:22
↓ 6 callersFunctions
(e,r)
testdata/twgl-full.min.js:6
↓ 6 callersFunctionue
(e,r,t)
testdata/twgl-full.min.js:6
↓ 6 callersFunctionupgradeServer
upgradeServer starts a server that upgrades with the extra response headers, and sends each request to the channel.
remote/internal/websocket/handshake_test.go:25
↓ 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:738
↓ 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:1090
↓ 5 callersMethodClose
()
remote/internal/websocket/conn_test.go:34
↓ 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 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
↓ 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
next →1–100 of 1,064, ranked by callers