зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1265208: Restore url if the value of inputed bar that had been inputting is empty upon switching tab. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D118125
This commit is contained in:
Родитель
e40714855d
Коммит
0142cb5790
|
@ -325,10 +325,11 @@ class UrlbarInput {
|
|||
let value = this.window.gBrowser.userTypedValue;
|
||||
let valid = false;
|
||||
|
||||
// Explicitly check for nulled out value. We don't want to reset the URL
|
||||
// bar if the user has deleted the URL and we'd just put the same URL
|
||||
// back. See bug 304198.
|
||||
if (value === null) {
|
||||
// Restore the selected browser's current URI if `value` is null or if it's
|
||||
// an empty string and we're switching tabs. In the latter case, when the
|
||||
// user makes the input empty, switches tabs, and switches back, we want the
|
||||
// URI to become visible again so the user knows what URI they're viewing.
|
||||
if (value === null || (!value && dueToTabSwitch)) {
|
||||
uri = uri || this.window.gBrowser.currentURI;
|
||||
// Strip off usernames and passwords for the location bar
|
||||
try {
|
||||
|
|
|
@ -77,8 +77,8 @@ add_task(async function() {
|
|||
await BrowserTestUtils.switchTab(gBrowser, deletedURLTab);
|
||||
is(
|
||||
gURLBar.value,
|
||||
"",
|
||||
'gURLBar.value should be "" after switching back to deletedURLTab'
|
||||
testURL,
|
||||
"gURLBar.value should be testURL after switching back to deletedURLTab"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.switchTab(gBrowser, fullURLTab);
|
||||
|
|
Загрузка…
Ссылка в новой задаче