Search mode is not exited when clicking a link or loading a page in the current tab
Categories
(Firefox :: Address Bar, defect, P2)
Tracking
()
People
(Reporter: itiel_yn8, Assigned: adw)
References
(Regressed 1 open bug)
Details
Attachments
(2 files)
STR:
- Open a new tab
- Type something in the urlbar
- Click the "Tabs" one-off button
- Click a top site tile from the new tab page
AR:
The top site is opened, but the "Tabs" search mode still appears on the urlbar
ER:
No "Tabs" label box
Assignee | ||
Comment 1•4 years ago
|
||
Ah... of course, we need to exit search mode when the tab navigates to anything, period. We currently clear it when you use the urlbar to navigate, but not when you click something in the page, for example, and there are probably other cases. Nice catch, thank you!
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
We need to exit search mode when a page loads in the current tab. We may need to
exit search mode for page loads in other tabs too: If you're in search mode,
click a slow link, switch tabs, and the page loads in the meantime, then search
mode should be not be entered when you switch back. I don't think we handle that
case correctly right now, and this patch doesn't address that at all. That's
worth doing in another bug because I think the fix will be different.
At first I added an onLocationChange
method to UrlbarInput that was called by
XULBrowserWindow.onLocationChange
in browser.js [1], just like we have an
onLocationChange
in UrlbarProviderSearchTips called by
XULBrowserWindow.onLocationChange
. But we need to potentially exit search mode
any time input.setURI
is called. setURI
happens to be called by
XULBrowserWindow.onLocationChange
, one of the several places that calls it
[2].
setURI
is also called when switching tabs. Bug 1647899 already took care of
handling search mode for tab switches, but it would be nice to handle all this
in one place. setURI
is also how userTypedValue
is restored in the input,
and of course userTypedValue
is something we need to restore when switching
tabs, just like search mode. For these reasons I moved per-tab search mode
restoration to setURI
as part of this.
I'm also changing the name of the second parameter in setURI
. I wasn't sure
whether it's true iff we're switching tabs, so I tracked down why that param was
added. It was added in bug 1478348, and comment 21 confirms it was added to tell
setURI
and XULBrowserWindow.onLocationChange
when they're being called due
to a tab switch. To make this clearer, I renamed the param and added some
javadoc for XULBrowserWindow.onLocationChange
.
[1] https://searchfox.org/mozilla-central/rev/50cb0892948fb4291b9a6b1b30122100ec7d4ef2/browser/base/content/browser.js#5205
[2] https://searchfox.org/mozilla-central/search?q=symbol:%23setURI&redirect=false
Assignee | ||
Comment 3•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 7•4 years ago
|
||
bugherder |
Comment 8•4 years ago
|
||
I verified this issue using 82.0a1 (2020-09-14) on macOS 10.13 and Windows 10 x64.
Adrian could you help me with Ubuntu verification?
Comment 9•4 years ago
|
||
I verified this issue using 82.0a1 (2020-09-15) on Ubuntu 20.04. Taking in account comment 8 and comment 9 marking this as verified.
Description
•