Bug 708161 - POST data for search engine submissions. r=mfinkle

This commit is contained in:
Brian Nicholson 2012-03-08 17:07:47 -08:00
parent 001b042a9a
commit f3c84d62f7

View File

@ -507,7 +507,7 @@ var BrowserApp = {
aParams = aParams || {};
let flags = "flags" in aParams ? aParams.flags : Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
let postData = ("postData" in aParams && aParams.postData) ? aParams.postData.value : null;
let postData = ("postData" in aParams && aParams.postData) ? aParams.postData : null;
let referrerURI = "referrerURI" in aParams ? aParams.referrerURI : null;
let charset = "charset" in aParams ? aParams.charset : null;
@ -830,16 +830,6 @@ var BrowserApp = {
});
},
getSearchOrURI: function getSearchOrURI(aParams) {
let uri;
if (aParams.engine) {
let engine = Services.search.getEngineByName(aParams.engine);
if (engine)
uri = engine.getSubmission(aParams.url).uri;
}
return uri ? uri.spec : aParams.url;
},
scrollToFocusedInput: function(aBrowser) {
let doc = aBrowser.contentDocument;
if (!doc)
@ -955,7 +945,15 @@ var BrowserApp = {
flags: flags
};
let url = this.getSearchOrURI(data);
let url = data.url;
if (data.engine) {
let engine = Services.search.getEngineByName(data.engine);
if (engine) {
let submission = engine.getSubmission(url);
url = submission.uri.spec;
params.postData = submission.postData;
}
}
// Don't show progress throbber for about:home
if (url == "about:home")