Bug 1357085 - Don't automatically redirect to Sync prefs after confirming an FxA sign-in or sign-up. r=markh
MozReview-Commit-ID: 6fwHcgqmFKJ
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -13,21 +13,16 @@ Cu.import("resource://gre/modules/FxAcco
var fxAccountsCommon = {};
Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon);
// for master-password utilities
Cu.import("resource://services-sync/util.js");
const ACTION_URL_PARAM = "action";
-const OBSERVER_TOPICS = [
- fxAccountsCommon.ONVERIFIED_NOTIFICATION,
- fxAccountsCommon.ONLOGOUT_NOTIFICATION,
-];
-
function log(msg) {
// dump("FXA: " + msg + "\n");
}
function updateDisplayedEmail(user) {
let emailDiv = document.getElementById("email");
if (emailDiv && user) {
emailDiv.textContent = user.email;
@@ -295,29 +290,20 @@ document.addEventListener("DOMContentLoa
var buttonOpenPrefs = document.getElementById("buttonOpenPrefs");
buttonOpenPrefs.addEventListener("click", openPrefs);
}, {capture: true, once: true});
function initObservers() {
function observe(subject, topic, data) {
log("about:accounts observed " + topic);
- if (topic == fxAccountsCommon.ONLOGOUT_NOTIFICATION) {
- // All about:account windows get changed to action=signin on logout.
- window.location = "about:accounts?action=signin";
- return;
- }
-
- // must be onverified - we want to open preferences.
- openPrefs();
+ window.location = "about:accounts?action=signin";
}
- for (let topic of OBSERVER_TOPICS) {
- Services.obs.addObserver(observe, topic);
- }
+ Services.obs.addObserver(observe, fxAccountsCommon.ONLOGOUT_NOTIFICATION);
+
window.addEventListener("unload", function(event) {
- log("about:accounts unloading")
- for (let topic of OBSERVER_TOPICS) {
- Services.obs.removeObserver(observe, topic);
- }
+ log("about:accounts unloading");
+ Services.obs.removeObserver(observe,
+ fxAccountsCommon.ONLOGOUT_NOTIFICATION);
});
}
initObservers();