зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1673490 - do not update bookmarks toolbar visibility for same-document navigations, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D95426
This commit is contained in:
Родитель
112cbb6dae
Коммит
fe2014a3ab
|
@ -5373,6 +5373,8 @@ var XULBrowserWindow = {
|
|||
// Do not update urlbar if there was a subframe navigation
|
||||
|
||||
if (aWebProgress.isTopLevel) {
|
||||
let isSameDocument =
|
||||
aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT;
|
||||
if (
|
||||
(location == "about:blank" &&
|
||||
BrowserUtils.checkEmptyPageOrigin(gBrowser.selectedBrowser)) ||
|
||||
|
@ -5392,7 +5394,8 @@ var XULBrowserWindow = {
|
|||
gURLBar.setURI(aLocationURI, aIsSimulated);
|
||||
|
||||
BookmarkingUI.onLocationChange();
|
||||
if (gBookmarksToolbar2h2020) {
|
||||
// If we've actually changed document, update the toolbar visibility.
|
||||
if (gBookmarksToolbar2h2020 && !isSameDocument) {
|
||||
let bookmarksToolbar = gNavToolbox.querySelector("#PersonalToolbar");
|
||||
setToolbarVisibility(
|
||||
bookmarksToolbar,
|
||||
|
|
|
@ -303,3 +303,33 @@ add_task(async function test_with_newtabpage_disabled() {
|
|||
await BrowserTestUtils.removeTab(blank);
|
||||
await BrowserTestUtils.removeTab(example);
|
||||
});
|
||||
|
||||
add_task(async function test_history_pushstate() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.toolbars.bookmarks.2h2020", true]],
|
||||
});
|
||||
await BrowserTestUtils.withNewTab("https://example.com/", async browser => {
|
||||
await waitForBookmarksToolbarVisibility({ visible: false });
|
||||
ok(!isBookmarksToolbarVisible(), "Toolbar should be hidden");
|
||||
|
||||
// Temporarily show the toolbar:
|
||||
setToolbarVisibility(
|
||||
document.querySelector("#PersonalToolbar"),
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
ok(isBookmarksToolbarVisible(), "Toolbar should now be visible");
|
||||
|
||||
// Now "navigate"
|
||||
await SpecialPowers.spawn(browser, [], () => {
|
||||
content.location.href += "#foo";
|
||||
});
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => gURLBar.value.endsWith("#foo"),
|
||||
"URL bar should update"
|
||||
);
|
||||
ok(isBookmarksToolbarVisible(), "Toolbar should still be visible");
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче