detached 70e775c

fix(omnibox): skip engine init in standalone mode

commit
70e775c2e521f8f1b00cacf28382981ed0273e9e
author
brice · · 2026-04-16 03:15 UTC
parent
2f5a6d2
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +20 -6
M cmd/dumber/main.go +20 -6
@@ -237,9 +237,15 @@ func runStandaloneOmnibox() int {
237237
238238 preInitializeAdwaitaForCEF(cfg, initResult, ui.EnsureAdwaitaInitialized)
239239
240- engine, repos, dbCleanup, err := initStackAndRepos(ctx, cfg, initResult, false)
240+ // Standalone omnibox intentionally skips browser-engine initialization.
241+ // When the main browser is already running under CEF, spinning up another CEF
242+ // engine for the omnibox process triggers Chromium's already-running-app
243+ // relaunch path and can turn the `omnibox` subcommand into a bogus browser
244+ // URL (`omnibox/`). The standalone omnibox only needs repos/use cases/theme;
245+ // actual browser navigation is handed off via LaunchBrowserURL.
246+ repos, dbCleanup, err := initStandaloneOmniboxRepos()
241247 if err != nil {
242- logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox runtime")
248+ logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox repositories")
243249 return 1
244250 }
245251 if dbCleanup != nil {
@@ -253,7 +259,7 @@ func runStandaloneOmnibox() int {
253259 initResult.ThemeManager,
254260 initResult.ColorResolver,
255261 initResult.AdwaitaDetector,
256- engine,
262+ nil,
257263 repos,
258264 useCases,
259265 nil,
@@ -264,7 +270,7 @@ func runStandaloneOmnibox() int {
264270 logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox UI dependencies")
265271 return 1
266272 }
267- runtimeCfg := ui.NewStandaloneOmniboxRuntime(ctx, uiDeps, engine.FaviconDatabase())
273+ runtimeCfg := ui.NewStandaloneOmniboxRuntime(ctx, uiDeps, nil)
268274
269275 return ui.RunStandaloneOmnibox(ctx, runtimeCfg)
270276 }
@@ -444,12 +450,20 @@ func initStackAndRepos(
444450 return nil, nil, nil, err
445451 }
446452
447- lazyDB, err := bootstrap.CreateLazyDatabase()
453+ repos, dbCleanup, err := initStandaloneOmniboxRepos()
448454 if err != nil {
449455 return nil, nil, nil, err
450456 }
457+ return engine, repos, dbCleanup, nil
458+}
459+
460+func initStandaloneOmniboxRepos() (*repositories, func(), error) {
461+ lazyDB, err := bootstrap.CreateLazyDatabase()
462+ if err != nil {
463+ return nil, nil, err
464+ }
451465 dbCleanup := func() { _ = lazyDB.Close() }
452- return engine, createLazyRepositories(lazyDB), dbCleanup, nil
466+ return createLazyRepositories(lazyDB), dbCleanup, nil
453467 }
454468
455469 func configureDeferredInit(
@@ -237,9 +237,15 @@ func runStandaloneOmnibox() int {
237 237
238 preInitializeAdwaitaForCEF(cfg, initResult, ui.EnsureAdwaitaInitialized)238 preInitializeAdwaitaForCEF(cfg, initResult, ui.EnsureAdwaitaInitialized)
239 239
240- engine, repos, dbCleanup, err := initStackAndRepos(ctx, cfg, initResult, false)240+ // Standalone omnibox intentionally skips browser-engine initialization.
241+ // When the main browser is already running under CEF, spinning up another CEF
242+ // engine for the omnibox process triggers Chromium's already-running-app
243+ // relaunch path and can turn the `omnibox` subcommand into a bogus browser
244+ // URL (`omnibox/`). The standalone omnibox only needs repos/use cases/theme;
245+ // actual browser navigation is handed off via LaunchBrowserURL.
246+ repos, dbCleanup, err := initStandaloneOmniboxRepos()
241 if err != nil {247 if err != nil {
242- logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox runtime")248+ logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox repositories")
243 return 1249 return 1
244 }250 }
245 if dbCleanup != nil {251 if dbCleanup != nil {
@@ -253,7 +259,7 @@ func runStandaloneOmnibox() int {
253 initResult.ThemeManager,259 initResult.ThemeManager,
254 initResult.ColorResolver,260 initResult.ColorResolver,
255 initResult.AdwaitaDetector,261 initResult.AdwaitaDetector,
256- engine,262+ nil,
257 repos,263 repos,
258 useCases,264 useCases,
259 nil,265 nil,
@@ -264,7 +270,7 @@ func runStandaloneOmnibox() int {
264 logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox UI dependencies")270 logging.FromContext(ctx).Error().Err(err).Msg("failed to initialize standalone omnibox UI dependencies")
265 return 1271 return 1
266 }272 }
267- runtimeCfg := ui.NewStandaloneOmniboxRuntime(ctx, uiDeps, engine.FaviconDatabase())273+ runtimeCfg := ui.NewStandaloneOmniboxRuntime(ctx, uiDeps, nil)
268 274
269 return ui.RunStandaloneOmnibox(ctx, runtimeCfg)275 return ui.RunStandaloneOmnibox(ctx, runtimeCfg)
270 }276 }
@@ -444,12 +450,20 @@ func initStackAndRepos(
444 return nil, nil, nil, err450 return nil, nil, nil, err
445 }451 }
446 452
447- lazyDB, err := bootstrap.CreateLazyDatabase()453+ repos, dbCleanup, err := initStandaloneOmniboxRepos()
448 if err != nil {454 if err != nil {
449 return nil, nil, nil, err455 return nil, nil, nil, err
450 }456 }
457+ return engine, repos, dbCleanup, nil
458+}
459+
460+func initStandaloneOmniboxRepos() (*repositories, func(), error) {
461+ lazyDB, err := bootstrap.CreateLazyDatabase()
462+ if err != nil {
463+ return nil, nil, err
464+ }
451 dbCleanup := func() { _ = lazyDB.Close() }465 dbCleanup := func() { _ = lazyDB.Close() }
452- return engine, createLazyRepositories(lazyDB), dbCleanup, nil466+ return createLazyRepositories(lazyDB), dbCleanup, nil
453 }467 }
454 468
455 func configureDeferredInit(469 func configureDeferredInit(

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close