Closed Bug 1638633 Opened 5 years ago Closed 5 years ago

Calling browser.search.search() leaves urlbar focused

Categories

(Firefox :: Address Bar, defect, P2)

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox76 --- wontfix
firefox77 --- unaffected
firefox78 --- unaffected
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- fixed

People

(Reporter: guido+bmo, Assigned: daisuke)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Depending on the "browser.newtabpage.enabled" and "browser.newtab.preload"
setting initiating a search in a new tab via browser.search.search()
will result in the urlbar being focused in the new tab.

I would consider this a bug because this differs with how the native search
from the urlbar and context menu work and it is inconsistent depending on
those two unrelated settings. Specifically, the urlbar will be focused after
calling browser.search.search() without specifying a tabId if

browser.newtabpage.enabled == false

or

browser.newtabpage.enabled == true
browser.newtab.preload == false

In all other cases focus is on the page content as it is with native search.

Hello Guido,

Would it be possible to attach the extension you used to uncover this issue and maybe a screen recording of the issue?

Thanks in advance !

Flags: needinfo?(guido+bmo)

You can easily reproduce this with my extension context-web-search by using its search function from the context menu.

Flags: needinfo?(guido+bmo)

Hello,

I have managed to reproduce the issue as per the provided STR on the latest Release (76.0.1/20200507114007) and Firefox 68.0 as orginally reported under Windows 10 Pro 64-bit and Ubuntu 16.04 LTS. The latest Nightly (78.0a1/20200527213321) and Beta (77.0/20200527121107) do not appear to be affected by the issue.

I have also performed a regression range on the issue and narrowed it down to https://bugzilla.mozilla.org/show_bug.cgi?id=1574169 (2020-05-28T14:13:09.407000: DEBUG : Found commit message:Bug 1574169 - Disable privileged content process for about:home for now. r=Gijs) with this differential revision https://phabricator.services.mozilla.com/D42209.

This is the corresponding pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d87604ba6a877c9f33b0fdd7723766c7e27dac93&tochange=42888edce5d83190ba6644cab576b28a43068e19.

Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true

Seems like an issue in the urlbar

Component: Frontend → Address Bar
Flags: needinfo?(mdeboer)
Product: WebExtensions → Firefox
Regressed by: 1574169

There is probably a race condition when webext uses addTab and the tab switcher focuses the urlbar.
I think the WebExtension api code should instead add a BrowserSearch.loadSearchFromExtension method and use the "webextension" telemetry source, that is the same code used by the contextual menu or the command line, so it should be a better tested path.
It can pass an openWhere param for "current", "tab" or "tabshifted".

If someone could try doing that and check if the problem is solved, it'd help a lot.

Severity: -- → S3
Flags: needinfo?(mdeboer)
Priority: -- → P2

I will take a look at this.

Assignee: nobody → daisuke
Status: NEW → ASSIGNED
Pushed by dakatsuka.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a45e38af7380 Introduce loadSearchFromExtension to use same mechanism as loadSearchFrom*. r=mak,robwu
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: