Get postData from session history instead of BrowserInstance. bug=46200, r=law, sr=alecf

This commit is contained in:
disttsc%bart.nl 2006-07-29 05:36:33 +00:00
parent 80a1014ec9
commit fe901e84cd
2 changed files with 12 additions and 5 deletions

View File

@ -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 {

View File

@ -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" );