From fe901e84cdc7cca165e6d7b2b9f0965ea1865826 Mon Sep 17 00:00:00 2001 From: "disttsc%bart.nl" Date: Sat, 29 Jul 2006 05:36:33 +0000 Subject: [PATCH] Get postData from session history instead of BrowserInstance. bug=46200, r=law, sr=alecf --- suite/common/contentAreaUtils.js | 7 +++++-- suite/common/nsContextMenu.js | 10 +++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/suite/common/contentAreaUtils.js b/suite/common/contentAreaUtils.js index fc73f068b561..612f0daccab8 100644 --- a/suite/common/contentAreaUtils.js +++ b/suite/common/contentAreaUtils.js @@ -85,11 +85,14 @@ // Default is to save current page. if ( !url ) url = window._content.location.href; - // Post data comes from appcore. + try { - postData = window.appCore.postData; + var sessionHistory = getWebNavigation().sessionHistory; + var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false); + postData = entry.postData; } catch(e) { } + // Use stream xfer component to prompt for destination and save. var xfer = Components.classes["@mozilla.org/appshell/component/xfer;1"].getService(Components.interfaces["nsIStreamTransfer"]); try { diff --git a/suite/common/nsContextMenu.js b/suite/common/nsContextMenu.js index 9c27c2c6cfcd..3570651a668b 100644 --- a/suite/common/nsContextMenu.js +++ b/suite/common/nsContextMenu.js @@ -672,11 +672,15 @@ nsContextMenu.prototype = { // Default is to save current page. if ( !url ) { url = window._content.location.href; - // Post data comes from appcore. - if ( window.appCore ) { - postData = window.appCore.postData; + + try { + var sessionHistory = getWebNavigation().sessionHistory; + var entry = sessionHistory.getEntryAtIndex(sessionHistory.index, false); + postData = entry.postData; + } catch(e) { } } + // Use stream xfer component to prompt for destination and save. var xfer = this.getService( "@mozilla.org/appshell/component/xfer;1", "nsIStreamTransfer" );