mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Bug 724239 - Loading a page in a new tab enables the back button; r=gavin,bz
This commit is contained in:
parent
225d52918d
commit
a76e21a256
@ -148,6 +148,7 @@ _BROWSER_FILES = \
|
||||
browser_bug664672.js \
|
||||
browser_bug710878.js \
|
||||
browser_bug719271.js \
|
||||
browser_bug724239.js \
|
||||
browser_bug735471.js \
|
||||
browser_bug743421.js \
|
||||
browser_bug749738.js \
|
||||
|
28
browser/base/content/test/browser_bug724239.js
Normal file
28
browser/base/content/test/browser_bug724239.js
Normal file
@ -0,0 +1,28 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
BrowserOpenTab();
|
||||
|
||||
let tab = gBrowser.selectedTab;
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
registerCleanupFunction(function () { gBrowser.removeTab(tab); });
|
||||
|
||||
whenBrowserLoaded(browser, function () {
|
||||
browser.loadURI("http://example.com/");
|
||||
|
||||
whenBrowserLoaded(browser, function () {
|
||||
ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history");
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function whenBrowserLoaded(aBrowser, aCallback) {
|
||||
aBrowser.addEventListener("load", function onLoad() {
|
||||
aBrowser.removeEventListener("load", onLoad, true);
|
||||
executeSoon(aCallback);
|
||||
}, true);
|
||||
}
|
@ -10018,7 +10018,7 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI * aURI)
|
||||
// should just do a spec compare, rather than two gets of the scheme and
|
||||
// then the path. -Gagan
|
||||
nsresult rv;
|
||||
nsCAutoString buf;
|
||||
nsCAutoString buf, pref;
|
||||
|
||||
rv = aURI->GetScheme(buf);
|
||||
if (NS_FAILED(rv))
|
||||
@ -10033,7 +10033,14 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI * aURI)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
rv = aURI->GetSpec(buf);
|
||||
NS_ENSURE_SUCCESS(rv, true);
|
||||
|
||||
rv = Preferences::GetDefaultCString("browser.newtab.url", &pref);
|
||||
NS_ENSURE_SUCCESS(rv, true);
|
||||
|
||||
return !buf.Equals(pref);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user