Open Bug 1643578 Opened 4 years ago Updated 2 years ago

Test that the urlbar gets focused for custom about:home/about:newtab pages

Categories

(Core :: DOM: Navigation, task, P3)

task

Tracking

()

REOPENED

People

(Reporter: pbone, Unassigned)

References

Details

Attachments

(2 files)

This is the original bug report for Bug 1634272, on that bug I fixed a different problem, so I'm filing a new bug to track the original problem:

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

install Group Speed Dial extension:
https://addons.mozilla.org/sk/firefox/addon/groupspeeddial/
click its toolbar icon / Options
in the Options page, click the "Copy homepage link" button (first line)
open "about:preferences#home" page and change the "Homepage and new windows" to "Custom URLs" and paste there the link
open New tab
type to addressbar "github.com" and press enter
press "Alt + Home" short-key

Actual results:

Addressbar is NOT focused

Expected results:

Addressbar should be focused.
This works in release 75 and ESR 68.
I can reproduce it in Beta 76.0b8 and Nightly 77

Hi Gijs,

Your name came up when I was talking with some people about "about:home". If you're the wrong person do you know who is the right person?

I've been looking at this bug but all the code that does the focus/not-focus the URL bar decision just checks for whether the URI is one of the blank pages using isBlankPageURL:

https://searchfox.org/mozilla-central/source/browser/base/content/utilityOverlay.js#74

I don't see any special handling for extensions. But the browser used to behave this way, at least with the extension in Bug 1634272 (I'll check there next to see if it's doing something special). So my question is. What's the intended behaviour of the browser? Does this already works as intended?

Thanks.

Flags: needinfo?(gijskruitbosch+bugs)

Before someone marks this as "Working as intended" by accident, I would like to point out that this is:

  1. not consistent - why should focusing addressbar behavior differ based on the URL on I use
  2. not consistent - addressbar is focused when New tab is opened, when new window is opened, when "Alt + Home" is pressed second time, when "Alt + Home" is pressed and user is on any extension page (so based on protocol???)
  3. not how it was working for years, so please don't make my life harder :)

It may be worth discussing whether to allow extensions overriding New tab page to control addressbar focus while their tab is focused.

(In reply to Paul Bone [:pbone] from comment #1)

So my question is. What's the intended behaviour of the browser? Does this already works as intended?

I'm pretty sure we're supposed to focus the address bar in the case described in comment #0 - the address bar is cleared (rather than showing the URL) so it's ready for typing.

I've been looking at this bug but all the code that does the focus/not-focus the URL bar decision just checks for whether the URI is one of the blank pages using isBlankPageURL:

https://searchfox.org/mozilla-central/source/browser/base/content/utilityOverlay.js#74

I don't see any special handling for extensions.

It's maybe not obvious, but the extension overrides the default new tab page, and the code at https://searchfox.org/mozilla-central/rev/f66f5a235e7d74c29b951316f73001126a056734/browser/base/content/utilityOverlay.js#33-65 means that BROWSER_NEW_TAB_URL should match. Which means that the utilityOverlay.js code you referenced, which is called (among others) from https://searchfox.org/mozilla-central/rev/f66f5a235e7d74c29b951316f73001126a056734/browser/base/content/browser.js#2857-2861 should match the URL copied in the STR.

I did a quick test and the URL the extension provides does indeed match BROWSER_NEW_TAB_URL (when overriding the new tab is permitted), so it's not clear to me off-hand why this isn't working. Have you looked for another place where focus changes, and/or used logging to verify what happens when isBlankPageURL is called?

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(pbone)

You can actually see that the addressbar gets focused for a moment and then it looses the focus.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(pbone)
Resolution: --- → DUPLICATE

We should add a test to browser_navigate_home_focuses_addressbar.js for this specific case.

Assignee: pbone → kmadan
Status: RESOLVED → REOPENED
Depends on: 1596738
Resolution: DUPLICATE → ---
Summary: Navigating home, when home is an extension, doesn't focus the urlbar → Test that the urlbar gets focused for custom about:home/about:newtab pages

Depends on D83754

Hi Kashav,

Here's what I have so far. I think that the test is correct but it's not passing yet (at least in my workspace with some other changes).

You're welcome to take this if you'd like, but I'm just as happy to finish it.

Flags: needinfo?(kmadan)

Thanks Paul. I had a similar test that was also failing locally. I can try to figure out what's going wrong.

Flags: needinfo?(kmadan)
Attachment #9163970 - Attachment description: Bug 1643578 - Test that extension as home page focuses address bar r=kashav → Bug 1643578 - Test that extension as home page focuses address bar r=pbone
Pushed by kmadan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a1183eb9107 Test that navigating to a http home page doesn't focus the address bar r=kashav https://hg.mozilla.org/integration/autoland/rev/e87edc47ce49 Test that extension as home page focuses address bar r=pbone

This was the test I added. I'll take a look.

Flags: needinfo?(pbone) → needinfo?(kmadan)

Thanks kashav.

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:kashav, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(kmadan)
Severity: -- → S3
Type: defect → task
Priority: P1 → P3
Type: task → defect
Type: defect → task
Type: task → defect
Blocks: 1597154
Type: defect → task
Keywords: regression
No longer regressed by: 1597154

Clearing assignee because Kashav is no longer at Mozilla.

Assignee: kshvmdn+bmo → nobody
Assignee: nobody → kshvmdn+bmo
Assignee: kshvmdn+bmo → nobody
Flags: needinfo?(u608768)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: