Closed Bug 1651372 Opened 4 years ago Closed 4 years ago

Custom new-tab pages don't have auto-focus on search-field

Categories

(Firefox :: General, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1596738
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox78 --- unaffected
firefox79 --- unaffected
firefox80 --- fixed

People

(Reporter: julianwels, Unassigned)

References

(Regression)

Details

(Keywords: regression)

80.0a1 (2020-07-08) (64-bit) on macOS

Until the last update, opening a new tab would automatically focus on the search-bar, even when the new-tab page was customized with an extension.

Now, when I open a new tab with a new-tab extension the search bar is not focused anymore. I tried it on two computers with the latest Nightly and multiple addons (like this one).

The search bar is still getting focused on Firefox Home and Blank Page.

Same issue here, really messing with my zen.

Same here. Might be related to 1628541.

this is messing with my zen too, funny how something so small can induce so much rage

I ran mozregression and that narrowed it down to bug 1599579. Oh this is about the search bar in the toolbar by the way, I didn't make that clear before.

Nika, do you have an idea why this is happening?

mozregression output:

Last good revision: d72c64af2c2372d7e69230f76650dabb3141287e
First bad revision: 2e058695addc755f908cd164ef1c7fca7d527eb7
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d72c64af2c2372d7e69230f76650dabb3141287e&tochange=2e058695addc755f908cd164ef1c7fca7d527eb7
Component: New Tab Page → General
Flags: needinfo?(nika)
Regressed by: 1599579
Has Regression Range: --- → yes

(In reply to Julian Gaibler from comment #4)

I ran mozregression and that narrowed it down to bug 1599579. Oh this is about the search bar in the toolbar by the way, I didn't make that clear before.

Nika, do you have an idea why this is happening?

mozregression output:

Last good revision: d72c64af2c2372d7e69230f76650dabb3141287e
First bad revision: 2e058695addc755f908cd164ef1c7fca7d527eb7
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d72c64af2c2372d7e69230f76650dabb3141287e&tochange=2e058695addc755f908cd164ef1c7fca7d527eb7

It's also happening to the address bar.

it seems to not really be about the bars themselves but that there's a hidden focus that targets the browser content element and it's not being released by the custom NTP. i think considering the fact that this only happens with a custom new tab page set up, it could be because someone moved the code that releases the focus from a UI script (that would be universal) to a script that's only called by the default new tab page. from what i understand, when things are working correctly, the focus doesn't automatically go to the search/url bar, there's a js function that does it

I think this has the same underlying cause as bug 1596738, in that it's caused by BCG replacements not preserving focus correctly. We've got some ideas for how to fix this, so hopefully we'll have it fixed soon.

Flags: needinfo?(nika)
See Also: → 1596738

I’m the developer of a custom new-tab add-on and I can confirm the address bar doesn’t receive focus when opening a custom new tab. Running Nightly, version 80.0a1 (2020-07-10) (64-bit) on macOS 10.15.5.

Is there any way to directly focus the urlbar from within my extension code? It doesn't look like there's any function or child of browser that just does that, and I don't think a webextension can just document.getElementById('urlbar-input').focus()
the only thing i can think of is an agent script that listens for new tab loads and focuses the urlbar and just load that with autoconfig

the above doesn't seem to work either so I don't see any way to fix my extension except I guess wait for a fix, but the priority and severity haven't been set and bug 1596738 is rated really low for something like this. it looks like that assessment was made before anyone connected it to this bug that makes custom new tab page extensions (which are pretty popular I think) unbearable to use for most people

Set release status flags based on info from the regressing bug 1599579

This will be fixed by bug 1596738.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
See Also: → 1643578
Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.