MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / extractBrowserConfig

Function extractBrowserConfig

agent/app/service/agents_utils.go:249–277  ·  view source on GitHub ↗
(conf map[string]interface{})

Source from the content-addressed store, hash-verified

247}
248
249func extractBrowserConfig(conf map[string]interface{}) browserConfig {
250 result := browserConfig{
251 Enabled: true,
252 ExecutablePath: defaultBrowserExecutablePath,
253 Headless: true,
254 NoSandbox: true,
255 DefaultProfile: defaultBrowserProfile,
256 }
257 browser, ok := conf["browser"].(map[string]interface{})
258 if !ok {
259 return result
260 }
261 if enabled, ok := browser["enabled"].(bool); ok {
262 result.Enabled = enabled
263 }
264 if executablePath, ok := browser["executablePath"].(string); ok && strings.TrimSpace(executablePath) != "" {
265 result.ExecutablePath = executablePath
266 }
267 if headless, ok := browser["headless"].(bool); ok {
268 result.Headless = headless
269 }
270 if noSandbox, ok := browser["noSandbox"].(bool); ok {
271 result.NoSandbox = noSandbox
272 }
273 if defaultProfile, ok := browser["defaultProfile"].(string); ok && strings.TrimSpace(defaultProfile) != "" {
274 result.DefaultProfile = defaultProfile
275 }
276 return result
277}
278
279func setBrowserConfig(conf map[string]interface{}, config browserConfig) {
280 browser := ensureChildMap(conf, "browser")

Callers 1

extractOtherConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected