Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chromedp/chromedp
/ functions
Functions
912 in github.com/chromedp/chromedp
⨍
Functions
912
◇
Types & classes
69
↓ 4 callers
Function
WithNewBrowserContext
WithNewBrowserContext makes a context create a new BrowserContext and a new target in it. A child context creates its target in this BrowserContext to
chromedp.go:734
↓ 4 callers
Function
defaultExecAllocatorOptions
defaultExecAllocatorOptions returns the options that NewContext uses to make the default allocator. It is the only place that builds that list from De
allocate.go:124
↓ 4 callers
Function
extract
extract extracts a block of next from a block of c++ code.
kb/gen.go:451
↓ 4 callers
Function
fakePipeConn
fakePipeConn returns a PipeConn that reads from in and writes to out.
pipe_test.go:27
↓ 4 callers
Method
noteLost
noteLost records that the connection to the browser process dropped. The allocator calls it when the connection drops without a graceful close. If the
browser.go:463
↓ 4 callers
Function
p
(e,r)
testdata/twgl-full.min.js:6
↓ 4 callers
Function
sleepContext
sleepContext sleeps for the specified duration. It returns ctx.Err() immediately if the context is canceled.
chromedp.go:968
↓ 4 callers
Function
startKept
startKept starts a headless browser with KeepOpen and runs one action in it. The cleanup kills the browser and removes its profile directory.
remote/keepopen_test.go:99
↓ 4 callers
Function
te
(e,r,t,n)
testdata/twgl-full.min.js:6
↓ 4 callers
Function
ve
(e)
testdata/twgl-full.min.js:6
↓ 4 callers
Function
w
(e,r)
testdata/twgl-full.min.js:6
↓ 4 callers
Method
xpath
xpath builds the xpath string.
node.go:94
↓ 3 callers
Method
AttributeValue
AttributeValue returns the named attribute for the node.
node.go:75
↓ 3 callers
Function
D
(e,r,t,n)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
DragAndDropXY
DragAndDropXY is an action that drags from the point fromX, fromY and drops at the point toX, toY. The points are in CSS pixels, relative to the viewp
drag.go:156
↓ 3 callers
Function
Emulate
Emulate is an action to emulate a specific device. See [device] for a set of ready-made devices and modes.
emulate.go:99
↓ 3 callers
Function
Focus
Focus is an element query action that focuses the first element node matching the selector.
query.go:859
↓ 3 callers
Function
FromNode
FromNode is an element query action option that sets the node where the query runs. That is, the query looks only at the element sub-tree of the node.
query.go:388
↓ 3 callers
Function
KeyEvent
KeyEvent is a key action that synthesizes a keyDown, char, and keyUp event for each rune in keys, with any key options. Only well-known, "printable"
input.go:224
↓ 3 callers
Function
KeyModifiers
KeyModifiers is a key action option to add modifiers to the key press.
input.go:260
↓ 3 callers
Function
PDFFooterTemplate
PDFFooterTemplate is like [PDFHeaderTemplate] for the footer.
pdf.go:177
↓ 3 callers
Function
PDFMargins
PDFMargins is an option of [PrintToPDF] that sets the margins in inches. The order is the same as in CSS: top, right, bottom and left.
pdf.go:128
↓ 3 callers
Function
PDFPageRanges
PDFPageRanges is an option of [PrintToPDF] that selects the pages to print, for example "1-3, 5". The numbers start at 1. The default is all pages.
pdf.go:143
↓ 3 callers
Function
PDFScale
PDFScale is an option of [PrintToPDF] that sets the scale of the page. The default is 1, and 0 gives the default, so PDFScale(0) changes nothing. The
pdf.go:137
↓ 3 callers
Function
PDFStream
PDFStream is an option of [PrintToPDF] that makes the browser send the file as a stream that the action reads in pieces, and not in one message. Use i
pdf.go:199
↓ 3 callers
Method
Read
Read reads the next message. It returns io.EOF when the browser closes its end of the pipe.
pipe.go:71
↓ 3 callers
Function
SetAttributeValue
SetAttributeValue is an element query action that sets the element attribute with name to value for the first element node matching the selector.
query.go:1111
↓ 3 callers
Function
SetValue
SetValue is an element query action that sets the JavaScript value of the first element node matching the selector. Use it to set the JavaScript valu
query.go:1008
↓ 3 callers
Function
Targets
Targets lists the targets of the browser of the context.
chromedp.go:951
↓ 3 callers
Function
WaitClosed
WaitClosed blocks until the browser process of the context exits, for example when the user closes the last window, or until ctx ends. It returns nil
keepopen.go:89
↓ 3 callers
Function
WaitNotPresent
WaitNotPresent is an element query action that waits until no element that matches the selector is present.
query.go:832
↓ 3 callers
Function
WithBrowserOption
WithBrowserOption passes browser options to the allocator when it allocates a new browser. As a result, you can use this option only when the context
chromedp.go:777
↓ 3 callers
Function
WithExistingBrowserContext
WithExistingBrowserContext makes a context create a new target in the given BrowserContext.
chromedp.go:750
↓ 3 callers
Method
Write
Write writes a message. It is safe to call from more than one goroutine.
pipe.go:97
↓ 3 callers
Method
WriteTo
WriteTo writes a readable representation of the node and all its children to w.
node.go:177
↓ 3 callers
Function
X
(e,r)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
Z
(e,r,t)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
be
(e,r)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
browserAlive
browserAlive reports whether a browser listens on the websocket address.
remote/keepopen_test.go:39
↓ 3 callers
Function
consolePreview
consolePreview renders the preview of an object, for example {a: 1, b: "x"} or [1, 2, 3]. A property that does not fit ends the list with an ellipsis.
console.go:394
↓ 3 callers
Function
consoleTime
consoleTime converts a protocol timestamp, in milliseconds, to a time.
console.go:200
↓ 3 callers
Function
consoleValue
consoleValue renders one value. A string stays as it is, a primitive has its value, and an object has its description, or a short form of its properti
console.go:360
↓ 3 callers
Method
domEvent
domEvent handles incoming DOM events.
target.go:394
↓ 3 callers
Function
ee
(e)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
execLocations
execLocations returns the names and paths that findExecPath tries for the operating system goos, in order.
allocate.go:649
↓ 3 callers
Method
execute
(ctx context.Context, method string, params, res any)
browser.go:246
↓ 3 callers
Function
fe
(e,r,t,n)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
getCode
getCode is a simple wrapper around parsing the code definition.
kb/gen.go:160
↓ 3 callers
Function
he
(e,r,t)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
headerServer
headerServer starts a websocket server that sends the headers of each handshake request to the returned channel. It holds each connection open until t
remote/conn_test.go:195
↓ 3 callers
Function
i
()
testdata/twgl-full.min.js:6
↓ 3 callers
Function
killKept
killKept kills the kept browser of ctx, waits until it exits and removes its profile directory.
remote/keepopen_test.go:52
↓ 3 callers
Function
l
(e)
testdata/twgl-full.min.js:6
↓ 3 callers
Method
listen
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:1007
↓ 3 callers
Function
me
(e,r)
testdata/twgl-full.min.js:6
↓ 3 callers
Function
navigateToHistoryEntry
navigateToHistoryEntry is an action that sends Page.navigateToHistoryEntry.
nav.go:111
↓ 3 callers
Function
newNode
newNode converts a protocol node and its descendants into a Node tree. It moves the child links from the protocol nodes to the new nodes.
node.go:45
↓ 3 callers
Function
newWebsocketServer
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:18
↓ 3 callers
Function
receiveHeader
(t *testing.T, headers <-chan http.Header)
remote/conn_test.go:207
↓ 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:802
↓ 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
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:496
↓ 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:755
↓ 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:1027
↓ 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.
action.go:151
↓ 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:395
↓ 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
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
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:1187
↓ 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:105
↓ 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:766
↓ 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
← previous
next →
101–200 of 912, ranked by callers