зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1715012 - [devtools] Use gBrowser.reloadTab in navigateTo when the provided URL is the same as the current one. r=ochameau.
In Bug 1710582, `refreshTab` switched to use `navigateTo` in order to handle target switching. The catch is that `navigateTo` uses `BrowserTestUtils.loadURI`, which triggers a slightly different behavior than `gBrowser.reloadTab` (for example, it does not keep the scroll position). In this patch, we modify `navigateTo` so it uses `reloadTab` if the URL provided for the navigation is the same as the current one. Differential Revision: https://phabricator.services.mozilla.com/D117018
This commit is contained in:
Родитель
91720f0159
Коммит
412f5b015d
|
@ -499,7 +499,14 @@ async function navigateTo(uri, { isErrorPage = false } = {}) {
|
|||
},
|
||||
isErrorPage
|
||||
);
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
|
||||
// if we're navigating to the same page we're already on, use reloadTab instead as the
|
||||
// behavior slightly differs from loadURI (e.g. scroll position isn't keps with the latter).
|
||||
if (uri === browser.currentURI.spec) {
|
||||
gBrowser.reloadTab(gBrowser.selectedTab);
|
||||
} else {
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
}
|
||||
|
||||
info(`Waiting for page to be loaded…`);
|
||||
await onBrowserLoaded;
|
||||
|
|
Загрузка…
Ссылка в новой задаче