Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chromedp/chromedp
/ functions
Functions
1,064 in github.com/chromedp/chromedp
⨍
Functions
1,064
◇
Types & classes
83
↓ 3 callers
Function
removeNode
(n []*Node, id cdp.NodeID)
util.go:305
↓ 3 callers
Function
responseAction
responseAction makes an action that runs the steps, waits until the page loads, and returns the response of the HTML document.
chromedp.go:877
↓ 3 callers
Method
setCmdEnv
setCmdEnv sets the environment of the command of the browser. The lowest priority is the environment of the Go process, unless NoInheritEnv is set. Th
allocate.go:754
↓ 3 callers
Function
startChrome
startChrome starts a browser with a debugging port and returns its websocket address. The cleanup of the test stops the browser.
remote/websocket_test.go:310
↓ 3 callers
Method
stop
stop ends the subscription at once, and drops the queued events. It is safe to call more than once.
session.go:167
↓ 3 callers
Function
unexpectedEOF
unexpectedEOF turns io.EOF into io.ErrUnexpectedEOF. A stream must not end in the middle of a frame.
remote/internal/websocket/frame.go:179
↓ 3 callers
Method
withExitError
withExitError returns err with the exit error of the browser process, when the process died while nobody had asked the browser to stop. Otherwise it r
browser.go:522
↓ 3 callers
Function
x
(e,r)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
xe
(e,r,t)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
ye
(e,r)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
After
After is an element query option that sets a func to run when the browser has returned the matched nodes and the node condition is true.
query.go:756
↓ 2 callers
Method
Allocate
Allocate creates a new browser. Canceling the provided context frees all resources of the browser, such as temporary directories.
allocate.go:27
↓ 2 callers
Function
Attributes
Attributes is an element query action that retrieves the element attributes for the first element node matching the selector.
query.go:1028
↓ 2 callers
Function
BrowserEvents
BrowserEvents is like [Events] for the events of the browser, such as the events of the target domain. It replaces ListenBrowser. Use [ListenBrowser]
action.go:154
↓ 2 callers
Function
ButtonType
ButtonType is a mouse action option to set the button to click.
input.go:164
↓ 2 callers
Function
ByFunc
ByFunc is an element query action option that sets the func that selects elements. It replaces the lookup that the type of the selector chooses. The s
query.go:396
↓ 2 callers
Function
CaptureScreenshot
CaptureScreenshot is an action that takes a screenshot of the current browser viewport. It acts like the command "Capture screenshot" in Chrome. See
screenshot.go:106
↓ 2 callers
Function
Debug
Debug reports whether the tests must log every protocol message. The variable CHROMEDP_DEBUG turns it on.
internal/testenv/testenv.go:80
↓ 2 callers
Method
Dump
Dump builds a printable string representation of the node and its children.
node.go:284
↓ 2 callers
Function
EmulateOrientation
EmulateOrientation is an emulate viewport option to set the device viewport screen orientation.
emulate.go:48
↓ 2 callers
Function
Encode
Encode returns an unmasked frame. It writes the shortest length encoding.
remote/internal/wstest/wstest.go:140
↓ 2 callers
Function
Env
Env sets environment variables, in the form NAME=value, for the new Chrome process. They add to the environment of the Go process, which os.Environ re
allocate.go:730
↓ 2 callers
Function
ExecPath
ExecPath returns the browser binary that the tests use. The variable CHROMEDP_TEST_RUNNER names it. Without the variable, ExecPath looks for a browser
internal/testenv/testenv.go:17
↓ 2 callers
Function
F
(e,r,t)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
FullScreenshot
FullScreenshot takes a full screenshot of the entire browser viewport, with the given image quality. It acts like the command "Capture full size scre
screenshot.go:124
↓ 2 callers
Method
FullXPath
FullXPath returns the full XPath for the node. It stops only at the top most document root.
node.go:172
↓ 2 callers
Function
K
(e,r,t,n,o)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
KeyEventNode
KeyEventNode is a key action that dispatches a key event on an element node.
input.go:245
↓ 2 callers
Function
ListenBrowser
ListenBrowser is like [Listen] for the events of the browser, such as the events of the target domain. The same rules hold for fn. As [BrowserEvents]
action.go:205
↓ 2 callers
Function
Main
Main runs the tests of a test binary. Call it from TestMain. It reads the environment variables of the tests, makes the exec allocator, runs the tests
internal/chromedptest/chromedptest.go:68
↓ 2 callers
Function
MouseClickXY
MouseClickXY is an action that sends a left mouse button click (that is, a mousePressed and a mouseReleased event) to the X, Y location.
input.go:49
↓ 2 callers
Function
NavigateBack
NavigateBack is an action that navigates the current frame backwards in its history, and waits for the page to load.
nav.go:57
↓ 2 callers
Function
NavigateResponse
NavigateResponse is like [Navigate], and returns the HTTP response of the HTML document.
nav.go:23
↓ 2 callers
Function
NavigationEntries
NavigationEntries is an action that retrieves the page's navigation history entries. The result holds the index of the current entry and the entries.
nav.go:43
↓ 2 callers
Function
NoSandbox
NoSandbox reports whether the tests must start the browser without its sandbox. It is true unless CHROMEDP_NO_SANDBOX is "false".
internal/testenv/testenv.go:74
↓ 2 callers
Function
OuterHTML
OuterHTML is an element query action that retrieves the outer html of the first element node matching the selector.
query.go:1188
↓ 2 callers
Function
PDFHeaderTemplate
PDFHeaderTemplate is an option of [PrintToPDF] that sets the HTML of the header, and turns on the header and the footer. The template can use these cl
pdf.go:169
↓ 2 callers
Function
PDFOutlineAndTagged
PDFOutlineAndTagged is an option of [PrintToPDF] that adds the outline of the document, which is a table of contents that a PDF viewer shows for the h
pdf.go:189
↓ 2 callers
Function
PDFPreferCSSPageSize
PDFPreferCSSPageSize is an option of [PrintToPDF] that uses the page size of the CSS rule @page, when the page has one. Otherwise the browser scales t
pdf.go:150
↓ 2 callers
Function
PDFPrintBackground
PDFPrintBackground is an option of [PrintToPDF] that prints the background colors and images. By default, the browser leaves them out.
pdf.go:156
↓ 2 callers
Function
Poll
Poll is a poll action that waits for a general JavaScript predicate. It builds the predicate from a JavaScript expression. This is a copy of [page.wa
poll.go:107
↓ 2 callers
Function
Populate
Populate is an element query option that retrieves the queried nodes for later use. Use a depth of -1 to retrieve all child nodes. When pierce is true
query.go:767
↓ 2 callers
Function
Q
(e,r,t,n,o)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
ScreenshotScale
ScreenshotScale is like [Screenshot] but takes a scale parameter, which is the page scale factor.
screenshot.go:36
↓ 2 callers
Function
ScrollIntoView
ScrollIntoView is an element query action that scrolls the window to the first element node matching the selector.
query.go:1411
↓ 2 callers
Method
SetDebugf
SetDebugf sets the protocol logger. NewBrowserTransport calls it with the logger of the browser.
pipe.go:124
↓ 2 callers
Function
Steps
Steps joins the actions into one action that runs them in order and stops at the first error. It replaces the type Tasks.
action.go:86
↓ 2 callers
Method
String
String returns the text that was written.
allocate.go:563
↓ 2 callers
Method
String
String returns the text that was kept.
allocate_pipe.go:118
↓ 2 callers
Method
String
String satisfies fmt.Stringer.
device/device.go:40
↓ 2 callers
Method
Subscribe
Subscribe starts to buffer the target events with the method, and returns the channel that the raw event parameters arrive on. It satisfies [cdp.Sessi
target.go:350
↓ 2 callers
Function
TapXY
TapXY is an action that sends a touch tap to the X, Y location. It sends a touchStart event and then a touchEnd event with one touch point. The browse
input.go:130
↓ 2 callers
Function
TextContent
TextContent is an element query action that retrieves the text content of the first element node matching the selector.
query.go:925
↓ 2 callers
Function
VisibleWindow
VisibleWindow reports whether the tests must show the window of the browser. The variable CHROMEDP_VISIBLEWINDOW asks for it, and so does the old name
internal/testenv/testenv.go:64
↓ 2 callers
Function
WaitEnabled
WaitEnabled is an element query action that waits until the element that matches the selector is enabled (that is, it has no attribute 'disabled').
query.go:821
↓ 2 callers
Function
WaitNewTarget
WaitNewTarget waits for the current target to open a new target. When fn matches a new target that is not attached, WaitNewTarget sends its target ID
chromedp.go:1099
↓ 2 callers
Function
WithAllocatorOptions
WithAllocatorOptions makes NewContext add opts to the options of the default allocator, after [DefaultExecAllocatorOptions] and after [VisibleWindow].
chromedp.go:669
↓ 2 callers
Function
WithBrowserDebugf
WithBrowserDebugf is a browser option that sets the func that receives the protocol messages.
browser.go:559
↓ 2 callers
Function
WithConnHTTPHeader
WithConnHTTPHeader is a dial option that sets HTTP headers on the websocket handshake request. For example, a hosted browser service can need an Autho
remote/conn.go:144
↓ 2 callers
Function
WithDetachOnCancel
WithDetachOnCancel makes the cancellation of the context detach from its tab and leave the tab open. By default, the cancellation closes the tab that
chromedp.go:711
↓ 2 callers
Function
WithDialHTTPHeader
WithDialHTTPHeader is an [Option] that sets HTTP headers on the websocket handshake request to the remote browser. A hosted browser service can need a
remote/allocator.go:131
↓ 2 callers
Function
WithErrorf
WithErrorf is a shortcut for WithBrowserOption(WithBrowserErrorf(f)).
chromedp.go:840
↓ 2 callers
Function
WithKeepOpen
WithKeepOpen makes chromedp.NewContext build the default allocator with chromedp.KeepOpen and with [WebSocket]. The browser then stays open when the p
remote/keepopen.go:15
↓ 2 callers
Function
WithListener
WithListener makes the context call fn for each event of its target, from the first message of the target. It is [Listen] from the start of the target
chromedp.go:765
↓ 2 callers
Function
WithPollingInFrame
WithPollingInFrame sets the frame in which to evaluate the predicate. Without it, the action evaluates the predicate in the root page of the current t
poll.go:167
↓ 2 callers
Method
WriteTo
WriteTo writes a readable representation of the node and all its children to w.
node.go:177
↓ 2 callers
Function
_
(e,r)
testdata/twgl-full.min.js:6
↓ 2 callers
Method
add
(ev any)
listen_test.go:25
↓ 2 callers
Function
addKey
addKey is a simple map add wrapper to panic if the key is already defined, and to lookup the correct scan code.
kb/gen.go:169
↓ 2 callers
Function
ae
(e,r,t,n)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
appendHeader
appendHeader appends the header of a client frame to b. The frame has the FIN bit set, the mask bit set and the given mask key. RFC 6455 section 5.2 s
remote/internal/websocket/frame.go:145
↓ 2 callers
Function
attributeMap
attributeMap returns the attributes of the node as a map.
query.go:1014
↓ 2 callers
Function
c
(e)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
ce
(e,r,t)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
checkDisplay
checkDisplay returns ErrNoDisplay when the environment has no X11 and no Wayland display.
allocate_linux.go:16
↓ 2 callers
Function
checkProse
checkProse reports each hit of proseRules in text. The first line of text is line first of the file.
docs/docs_test.go:187
↓ 2 callers
Function
clearFrameState
clearFrameState clears the frame state via bit clear (&^).
util.go:53
↓ 2 callers
Method
close
close ends all subscriptions, and makes later subscriptions end at once. A subscription first delivers the events that it already holds, so that a rea
session.go:115
↓ 2 callers
Method
closeChild
closeChild closes the ends that only the browser process needs. Calling it more than once is safe.
allocate_pipe.go:81
↓ 2 callers
Method
closeParent
closeParent closes the ends of the parent process. Calling it more than once is safe.
allocate_pipe.go:91
↓ 2 callers
Function
collectConsole
collectConsole reads the messages until the message with the text stop.
console_test.go:18
↓ 2 callers
Function
commandArgs
commandArgs starts a browser with a program that does not exist and returns the arguments that ModifyCmdFunc saw. Allocate fails after it, which the t
allocate_test.go:532
↓ 2 callers
Function
consoleText
consoleText renders the arguments of a call of the console API as the DevTools console does.
console.go:267
↓ 2 callers
Function
d
(e,r)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
de
(e,r,t,n,o)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
decodeReply
decodeReply returns the error of a reply to a command, or decodes its result into res. A nil msg means that the channel of the reply closed.
browser.go:306
↓ 2 callers
Function
defaultContextFrames
defaultContextFrames returns the frames that have a default JavaScript context in the events.
listen_test.go:194
↓ 2 callers
Function
describe
describe returns the text of a selector for error messages.
query.go:439
↓ 2 callers
Method
dial
dial connects to the websocket address wsURL with the dialer of the allocator, and returns a browser that uses the connection.
allocate.go:496
↓ 2 callers
Method
documentUpdated
documentUpdated handles the document updated event. It retrieves the document root for the root frame.
target.go:393
↓ 2 callers
Method
dropWorlds
dropWorlds forgets the isolated world of the frame with the id, or of every frame when the id is empty, because a new document has none of the old wor
target.go:166
↓ 2 callers
Method
enclosingFrame
(node *Node)
target.go:70
↓ 2 callers
Function
endWith
endWith returns the session s with subscriptions that end when ctx ends. Without it, an iterator that nobody reads keeps its subscription, and a gorou
action.go:279
↓ 2 callers
Method
ensureFrame
ensureFrame makes sure that the top frame of this target is loaded. It returns the top frame, the root node, and the ExecutionContextID of the top fra
target.go:96
↓ 2 callers
Function
fetch
fetch downloads path from one source.
kb/gen.go:474
↓ 2 callers
Function
findExecPath
findExecPath looks for the Chrome browser on the system. It looks in different places on different operating systems. The search can be aggressive and
allocate.go:635
↓ 2 callers
Method
flagArgs
flagArgs returns the command line arguments for the flags of the allocator.
allocate.go:446
↓ 2 callers
Function
h
(e,r)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
ie
(e,r)
testdata/twgl-full.min.js:6
↓ 2 callers
Function
isAttacher
isAttacher reports whether a attaches to a browser that runs already. See [Attacher].
chromedp.go:437
← previous
next →
201–300 of 1,064, ranked by callers