Bug 965472 - about:accounts should open a new tab to display legacy sync info. r=ttaubert, a=sledru
authorMark Hammond <mhammond@skippinet.com.au>
Fri, 14 Feb 2014 09:08:37 +1100
changeset 183064 0c1900b58f65c1d1c4e8d6bf54594ffed2585e39
parent 183063 2ce26da7f4adc8125248a1b911abd918ee02eeb8
child 183065 62881d64ba58a4c2702657b7c57650fe9043f0ad
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, sledru
bugs965472
milestone29.0a2
Bug 965472 - about:accounts should open a new tab to display legacy sync info. r=ttaubert, a=sledru
browser/base/content/aboutaccounts/aboutaccounts.js
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -221,18 +221,26 @@ let wrapper = {
     };
     this.iframe.contentWindow.postMessage(data, authUrl);
   },
 };
 
 
 // Button onclick handlers
 function handleOldSync() {
-  // we just want to navigate the current tab to the new location...
-  window.location = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync";
+  let chromeWin = window
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIWebNavigation)
+    .QueryInterface(Ci.nsIDocShellTreeItem)
+    .rootTreeItem
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIDOMWindow)
+    .QueryInterface(Ci.nsIDOMChromeWindow);
+  let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync";
+  chromeWin.switchToTabHavingURI(url, true);
 }
 
 function getStarted() {
   hide("intro");
   hide("stage");
   show("remote");
 }