MCPcopy
hub / github.com/go-rod/rod / Get

Method Get

lib/launcher/browser.go:155–166  ·  view source on GitHub ↗

Get is a smart helper to get the browser executable path. If [Browser.BinPath] is not valid it will auto download the browser to [Browser.BinPath].

()

Source from the content-addressed store, hash-verified

153// Get is a smart helper to get the browser executable path.
154// If [Browser.BinPath] is not valid it will auto download the browser to [Browser.BinPath].
155func (lc *Browser) Get() (string, error) {
156 defer leakless.LockPort(lc.LockPort)()
157
158 if lc.Validate() == nil {
159 return lc.BinPath(), nil
160 }
161
162 // Try to cleanup before downloading
163 _ = os.RemoveAll(lc.Dir())
164
165 return lc.BinPath(), lc.Download()
166}
167
168// MustGet is similar with Get.
169func (lc *Browser) MustGet() string {

Callers 15

MustGetMethod · 0.95
mainFunction · 0.45
currentVerFunction · 0.45
getIssueFunction · 0.45
deleteCommentsFunction · 0.45
mainFunction · 0.45
getDeviceListFunction · 0.45
getUserAgentFunction · 0.45
findMethod · 0.45
parseFunction · 0.45
parseDomainFunction · 0.45
parseDefFunction · 0.45

Calls 4

ValidateMethod · 0.95
BinPathMethod · 0.95
DirMethod · 0.95
DownloadMethod · 0.95

Tested by 9

TestManagedFunction · 0.36
TestLaunchUserModeFunction · 0.36
TestAppModeFunction · 0.36
TestProfileDirFunction · 0.36
TestWebSocketHeaderFunction · 0.36
newPageFunction · 0.36
TestBasicFunction · 0.36
TestCrashFunction · 0.36
ExampleClientFunction · 0.36