Bug 835241 - Reload button reloads cached copy r=bnicholson
authorMark Finkle <mfinkle@mozilla.com>
Mon, 28 Jan 2013 19:14:42 -0500
changeset 130000 595c77e4624c056bf8c447032acb2ebb253dcddd
parent 129999 c73b57a20d1b67261b726cf208e10d7359c22812
child 130001 1a1a910c8e9ed0906c6650d1c76929c1140f69b7
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs835241
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 835241 - Reload button reloads cached copy r=bnicholson
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1107,17 +1107,27 @@ var BrowserApp = {
         browser.goBack();
         break;
 
       case "Session:Forward":
         browser.goForward();
         break;
 
       case "Session:Reload":
-        browser.reload();
+        // Try to use the session history to reload so that framesets are
+        // handled properly. If the window has no session history, fall back
+        // to using the web navigation's reload method.
+        let flags = Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
+        let webNav = browser.webNavigation;
+        try {
+          let sh = webNav.sessionHistory;
+          if (sh)
+            webNav = sh.QueryInterface(Ci.nsIWebNavigation);
+        } catch (e) {}
+        webNav.reload(flags);
         break;
 
       case "Session:Stop":
         browser.stop();
         break;
 
       case "Tab:Load": {
         let data = JSON.parse(aData);