Skip to content

Fix omnibox opening in wrong tab

Administrator requested to merge erzhtor/fix-omnibox-opening-in-wrong-tab into main

Created by: erzhtor

Closes https://github.com/sourcegraph/sourcegraph/issues/23475.

Description

First of all, I think, this is a very rare case bug.

It happens because when enter is pressed the omnibox/src logic is running asynchronously in the background script, such as:

  • getting current active tab
  • getting sourcegraph URL

So if user switches really quickly active tab might change before omnibox handler logic detects current active tab.

This PR changes logic to store current active tab whenever it changes and freezes its value for the period of omnibox logic handler.

How to test

See issue description.

Before merging

Merge request reports

Loading