Bug 969474 - fix behaviour of 'back' button on about:accounts. r=adw

This commit is contained in:
Mark Hammond 2015-09-11 10:41:03 +10:00
parent 6d8b0be7bc
commit 7490b3e17b
2 changed files with 7 additions and 4 deletions

View File

@ -127,12 +127,15 @@ let wrapper = {
url += (url.includes("?") ? "&" : "?") + urlParamStr;
}
this.url = url;
iframe.src = url;
// Set the iframe's location with loadURI/LOAD_FLAGS_BYPASS_HISTORY to
// avoid having a new history entry being added.
let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
},
retry: function () {
let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
webNav.loadURI(this.url, null, null, null, null);
webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
},
iframeListener: {

View File

@ -36,7 +36,7 @@ addEventListener("DOMContentLoaded", function domContentLoaded(event) {
return;
}
removeEventListener("DOMContentLoaded", iframeLoaded, true);
sendAsyncMessage("test:iframe:load", {url: iframe.getAttribute("src")});
sendAsyncMessage("test:iframe:load", {url: iframe.contentDocument.location.href});
// And an event listener for the test responses, which we send to the test
// via a message.
iframe.contentWindow.addEventListener("FirefoxAccountsTestResponse", function (event) {
@ -79,7 +79,7 @@ addMessageListener("test:load-with-mocked-profile-path", function (message) {
}
iframe.removeEventListener("load", iframeLoaded, true);
sendAsyncMessage("test:load-with-mocked-profile-path-response",
{url: iframe.getAttribute("src")});
{url: iframe.contentDocument.location.href});
}, true);
});
let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);